1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

301 redirect - different method.

Discussion in 'White Hat SEO' started by darrensss, May 28, 2011.

  1. darrensss

    darrensss Power Member

    Joined:
    Jun 10, 2010
    Messages:
    697
    Likes Received:
    79
    Hi.

    When i normally set up a 301 redirect i use .htaccess .
    This is going to be a problem for one reason or another so i need another way of doing it ...
    I found this php way ...

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


    will this work? If i place this in the old page?
    will google treat this in the same way it would if i did it via .htaccess?
     
  2. Autumn

    Autumn Elite Member

    Joined:
    Nov 18, 2010
    Messages:
    2,197
    Likes Received:
    3,041
    Occupation:
    I figure out ways to make money online and then au
    Location:
    Spamville
    It works exactly the same, a 301 is a 301.

    This method is useful if you just want to redirect a single page because the code will only be called when that page is fetched; with the .htaccess method, the .htaccess file is parsed for every retrieval of every page on the site - so it means lower server load for a single page redirect.