On Webserve, how do I redirect to a different URL using the meta refresh tag?

Important:
On Webserve, PHP 7.1 will become the default version in spring 2018; however, PHP 5.6 will still be available until it is retired at the end of December 2018. For help specifying which version of PHP to use, see PHP server-side scripting language.

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.

Redirecting users with the .htaccess file

You can also redirect users to a different URL using the .htaccess file; see On Webserve, how do I redirect to a different URL using the .htaccess file?

This is document bfrh in the Knowledge Base.
Last modified on 2017-07-01 00:38:45.

  • Fill out this form to submit your issue to the UITS Support Center.
  • Please note that you must be affiliated with Indiana University to receive support.
  • All fields are required.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.

  • Fill out this form to submit your comment to the IU Knowledge Base.
  • If you are affiliated with Indiana University and need help with a computing problem, please use the I need help with a computing problem section above, or contact your campus Support Center.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.