02.22.07

Meta Refresh Redirect

Posted in HTML, Web Design at 3:29 pm by Keith

One of the easiest ways to redirect one web page to another is through a meta refresh tag. I prefer this method to using javascript as not everyone has javascript enabled.

To redirect visitors from one page to another you can add the meta refresh tag to the page you want to redirect from. Add the tag between the opening and closing head tags.

The important part will look something like this:

<meta http-equiv=”refresh” content=”0;url=http://techtips.foundnews.com“>

The relevant parts are the number 0 and the url. The number 0 is the number of seconds before the page is redirected, and the url is where you want the page redirected to. So, adding the above code between the head tags of your web page would make it instantly (in 0 seconds) redirect to http://techtips.foundnews.com. If you want to display a message about the redirect you can add it to the page you are redirecting from and increase the time from 0 seconds to a time, in seconds, long enough for visitors to read the message.

Powered by Gregarious (34)

2 Comments »

  1. Joseph Rukshan Fonseka said,

    February 23, 2007 at 6:01 am

    This is good but not so good for search engines. If you want to redirect your visitors in a more search engine friendly way then use the rewrite rules in .htaccess file or using php you can do something like this:

  2. Joseph Rukshan Fonseka said,

    February 23, 2007 at 6:02 am

    That php code is:

    <?
    Header( “HTTP/1.1 301 Moved Permanently” );
    Header( “Location: http://www.new-url.com” );
    >>

Leave a Comment

Socialized through Gregarious 34
Close
E-mail It