Thursday 1 November 2007

SEO : redirect method (301 and 302) CS3382 - Week 8

301(Permanently Moved), 302(Temporarily Moved) are often used because of the web hosting of website changes.
The method and steps need to do as the followings
(taking Linux using Apache as web server as example):


  1. Redirect 301 In PHP
    <?
    Header( "HTTP/1.1 301 Moved Permanently" ) ;
    Header( "Location: http://www.bloghuman.com" );
    ?>
  2. Setting .htaccess file in the root directory of the website
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://www.fromHere.com/$1 [R=301,L]
    rewritecond %{http_host} ^ToHere.com [nc]
Tools

No comments: