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

The Webserve and Webtest servers use PHP 7.1; PHP 5.6 has been retired and is no longer available. For more about PHP at IU, 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.

    <title>Web Services Support redirect</title>
    <META http-equiv="refresh" content="5;URL=">
  <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=""></a>

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=">

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 Webserve to redirect to a different URL.

This is document bfrh in the Knowledge Base.
Last modified on 2018-11-16 08:12:30.

Contact us

For help or to comment, email the UITS Support Center.