Friday, 9 September 2011

How to Automatic Redirect web page

I just have an idea, i want to auto redirect web pages after some time interval.

To make a page redirect itself we have to use the HTML Meta Tag inside the head tag
Example:

<meta http-equiv="refresh" content="5; url=http://www.indonetasia.com">

This code will redirect your webpage to the url http://www.indonetasia.com after 5 seconds.
The attribute http-equiv="refresh" calls for refresh of the page.


The attribute content="5; URL=http://www.indonetasia.com" sets the time interval in seconds after which the page redirection will take place and the destination page.
Make sure you follow the exact order of coding.


i.e: content="time interval in seconds; URL=resulting page";

Note : you can not use semicolon after 'url='.
So using this meta tag will redirect the page to the destination page after the time interval. To make the page to redirect to a pre-defined page edit the attribute "content" and set proper values of time and destination url as required.


This will work on all pages with any extension or server side language (php, jsp, asp, etc...).

No comments:

Post a comment

Popular Posts