19-Apr-2015

Automatically redirecting visitors to another page

If your website changes location it's polite, and good business, to gracefully redirect them to the new location.


(from http://www.webdevelopersnotes.com/tips/html/automatically_redirecting_visitors_to_another_page_.php3)

A remedy for this problem would be to use an automatic redirection and we employ thetag to accomplish this job.

Using the http-equiv and content attributes with appropriate values, we can set up this redirection.

<meta http-equiv="refresh" content="10; url=somepage.html">

Thetag has to be included in the HTML head. The content attribute takes two values. The first specifies the number of seconds for the page to refresh and the second is the page URL address. (Note: These two values are enclosed in only ONE pair of quotes and separated by a colon).

The code above redirects the user to somepage.html in 10 seconds.

It is also wise to include a link to the new page in the HTML body section for older browsers that do not recognize thetag, something like:

The page has been moved here

Leave a Reply

linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram