Feb 01

how to redirect page with time interval

Some time we need to redirect page to some other page or url within some time limit.

fortunately its really easy todo do with HTML's meta tag

Meta tag
<meta [email protected]@equiv="refresh" content="10;url=http://example.com/">
replace @[email protected] with - in above line, due to security reason it is replced in above code.

here content="10;url=http://example.com/" is essential part 10 is the seconds, after how much seconds page will get redirect to give http://example.com/ URL

Generally we can pair this meta tag with some page description for informing user what is happening.

replace @[email protected] with - in above line, due to security reason it is replced in below code.
Some description for redirection
<html>
  <head>
    <meta [email protected]@equiv="refresh" content="10;url=http://example.com/">
    <title>Page Moved</title>
  </head>
  <body>
    This page has moved. Click 
    <a href="http://www.example.com">here</a> to go to the new page. 
    OR page will refresh to new URL in 10 seconds automatically.
  </body>
</html>

This can be really smart and easy way to redirect users on temporary basis.

Ad
Ad