Meta Tag "Refresh" Redirection

DataMine
by DataMine · 2 posts
11 years ago in HTML & CSS
Posted 11 years ago · Author
Redirect to a Different URL using the Meta Tag "Refresh"

Code
<meta http-equiv="Refresh" content="5; url=SOME URL">


Background
You may need to redirect people to a different page because a URL has changed or was incorrect when printed or released. By using the "refresh" tag you can easily let the user know the correct new URL and can automatically redirect them to the new page. The refresh tag can also help you to make your site more user-friendly; if the correct URL is easy to misspell or confusing, you can make sure that users get to the right page by providing a page at the "wrong" address that will automatically redirect them to the correct URL.

Sample Code
Note that meta tags go in the <HEAD> </HEAD> section of the HTML document.Also, text within the title tag plays an important role in putting your web pages to rank high for searches. Therefore it is important to change the text within the title tags.

Code
<html> 
  <head>
    <title>IU Webmaster redirect</title>
    <META http-equiv="refresh" content="5;URL=SOME URL">
  </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.
    </center>
  </body>
</html>


You can change the amount of time that this redirecting page is displayed by changing the number in the refresh content="5 portion of the meta tag statement. If you want to have your visitors automatically taken to the correct page, then set the number equal to zero.

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 a good practice to indicate that the redirecting page will only be provided for a limited time and urge visitors to bookmark the new location.

Not all browsers support the Meta "refresh" function, so it's always a good idea to include a clickable link to the new or correct URL.


Source: http://webmaster.iu.edu/tools-and-guide ... resh.phtml
Posted 11 years ago
Thanks for the post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here

SIGN IN NOW

Create an account

Sign up for a new account in our community. It's easy!

REGISTER A NEW ACCOUNT