HTML Hyper Text Markup Language: How To Redirect To A Diiferent Page Or SiteUsing the Meta Tag "Refresh" to Redirect to a Different URLIf you need to send visitors to your site to a different URL automatically, try using the meta tag http-equiv refresh. 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 ask them to bookmark the correct page, and you can also cause the browser to take them to the correct URL in a specified number of seconds. 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. For example, Professor Smith\'s L200 class materials are located at http://www.indiana.edu/~smithclas/l200/. However, he soon realizes that some of his students are going to http://www.indiana.edu/~smithclas/1200/, mistaking the lower-case letter \'l\' in the correct URL for the numeral 1. Since he wants to make sure that all of his students can find their homework assignments, he can redirect them from the incorrect http://www.indiana.edu/~smithclas/1200/ URL to the course materials page at http://www.indiana.edu/~smithclas/l200/. To do this, Prof. Smith would create a new subdirectory called \'1200\'. Then he would create an index.html page in the 1200 subdirectory that will redirect his students to l200, using the meta tag "refresh". Note that meta tags go in the section of the HTML document. Here is the coding for a simple page to do this -- just copy and paste:
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, as in this example:
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. |