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

Example:
meta equiv="refresh" content="5; url=http://www.another-site.com"

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=http://www.another-site.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 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.

2 comments:

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.

Anonymous said...

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