07-08-2008

PHP 301 redirect

The 301 redirect is the most efficient and search engine friendly method for webpage redirection. If you have to change file names or move pages around, it's the safest option.

The correct way to do this redirect using php headers:

<?php
      header( "HTTP/1.1 301 Moved Permanently" );
      header( "Status: 301 Moved Permanently" );
      header( "Location: http://www.new-location.com/" );
      exit; // This is Optional but suggested, to avoid any accidental output 
?>

Comments:

Your comment:

»

 

[x]