ARCHIVED: Use the meta refresh tag on Webserve to redirect to a different URL

This content has been archived, and is no longer maintained by Indiana University. Information here may no longer be accurate, and links may no longer be available or reliable.

On this page:


Overview

If a URL has changed or was incorrect when it was printed or released, you can use the meta refresh tag to let users know the correct URL and automatically redirect them to the new page. The refresh tag can also help make your site more user friendly; if the correct URL is confusing or easy to misspell, you can provide a page at the "wrong" address that automatically redirects users to the correct URL.

Meta refresh example

Note that meta tags go in the <head> </head> section of the HTML document. Also, text within the title tags plays an important role in ranking web pages high for searches. Therefore, it is important to change the text within the title tags.

<html>
  <head>
    <title>Web Services Support redirect</title>
    <META http-equiv="refresh" content="5;URL=http://www.indiana.edu/~account/new-directory">
  </head>
  <body bgcolor="#ffffff">
    <center>The contents you are looking for have moved. You will be redirected to the new location automatically in 5 seconds. Please bookmark the correct page at <a href="http://www.indiana.edu/~wmhelp/new-directory"> http://www.indiana.edu/~wmhelp/new-directory</a>
    </center>
  </body>
</html>

The number in the refresh content="5 portion of the meta tag statement determines how many seconds a redirecting page displays. To immediately send visitors to the correct page, set the number to 0, as in this example:

<META http-equiv="refresh" content="0;URL=http://www.indiana.edu/~account/new-directory">

If you would like to use a redirecting page because a URL has changed, simply replace the document at the original location with one that redirects users to the new URL. It's good practice to indicate that the redirecting page will only be available for a limited time and urge visitors to bookmark the new location.

Not all browsers support meta refresh, so it's a good idea to include a clickable link to the correct URL.

Redirect users with the .htaccess file

You can also redirect users to a different URL using the .htaccess file; see Use the .htaccess file on Sitehost to redirect to a different URL.

This is document bfrh in the Knowledge Base.
Last modified on 2021-09-08 10:23:40.