Monday, August 06, 2007

URL Redirection...

I received an email asking about HTML Code for redirection of a web page to another?

To make a page redirect, we can use the HTML Meta Tag inside the head tag

meta equiv="refresh" content="5; url="

This code will redirect your webpage to the new url after 5 seconds.
The attribute http-equiv="refresh" calls for refresh of the page.
The attribute content="5; URL=" 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 that you should not use semicolon after 'url='.So using this meta tag will redirect the page to the destination page after the time interval.


Ahamad said...

Do not forget to add opening and closing brackets for the code.(< and >)

Blogger does not allow these to be posted in the code.

Arindam said...

Good post buddy :). we should also know why url redirection is done.