The University of Texas at Austin- What Starts Here Changes the World
Services Navigation


Meta Refresh

Another technique for redirecting people to new pages is using a special meta tag, "meta refresh," within the head section of your HTML document. The browser will read this meta tag and follow the instructions within the tag. This technique is normally used to accomplish two tasks:

  • redirect people to the new destination and

  • let them know that the destination has changed, so they can update their bookmarks.

Therefore, we recommend you include a message in the body of your HTML document saying that the page has moved and you will be redirected to the new site in n seconds, whatever n happens to be. See We've Moved as an example.

Syntax is:

<meta http-equiv="refresh" content="n; url=url">

where

n = time, in seconds, until the page should be redirected.
url = the URL that should be loaded after n seconds.

For example,

<META HTTP-EQUIV=Refresh CONTENT="10; URL=http://www.utexas.edu/its/">

tells the browser to load http://www.utexas.edu/its/ 10 seconds after the current document has finished loading. This may not be supported by all browsers, so put a "we've moved" message in your document as shown above. Also, since some search engines may penalize pages that refresh after a few seconds or less, you should use 5 or more seconds.

Advantages

  • Control over the redirection without contacting the system administrator.
  • Can inform the user about the site change.

Disadvantages

  • Supported only by certain browsers like Netscape. If you use a meta-refresh redirection page, you should include a link to your site so that users with browsers that don't recognize meta-refresh can follow the link to your new site.
  • Only works for the specific page that contains the META tag. If your site has multiple pages, with this method you will have to create a redirection page for each page.

More Information

 



  Updated 2003 July 29
  Comments to TeamWeb