How do I redirect my site using a META Tag?


  • Applies to: All Service Types
    • Difficulty: Medium
    • Time Needed: 10
    • Tools Required: FTP or SSH, plain text editor

Overview

This document will explain how to create a META Tag to redirect your site or site content. This will not redirect any emails for your domains, however.

READ ME FIRST

This article is provided as a courtesy. Installing, configuring, and troubleshooting third-party applications is outside the scope of support provided by (mt) Media Temple. Please take a moment to review the Statement of Support.

Instructions

It is preferable for a number of reasons to redirect your site using a 301 Redirect rather than a meta refresh. However, there may be some cases in which a meta refresh is necessary.

  • You cannot use a .htaccess file - for example, you may be using a CMS which periodically overwrites your .htaccess file.
  • You want to redirect only a single file in a directory with multiple other files.


You should insert the following line in the head section of your HTML page, replacing http:example.com/ with the actual web page to which you want to redirect your viewers:

<meta http-equiv="refresh" content="2;url=http://example.com/" />

Here is an example with the correct line inserted in a typical HTML page. Note that it comes above the title tag.


<html>
<head>
<meta http-equiv="refresh" content="2;url=http://example.com" />
<title>Page Moved</title>
</head>
<body>
This page has moved. Click <a href="http://www.example.com">here</a> to go to the new page.
</body>
</html>

Additional resources and examples

These are third-party pages that are in no way associated with (mt) Media Temple.