buchin

301 Redirect with PHP

Redirection is common method to retrive the lost traffic, we canredirect old trafffic to the new one. Usually this can be done using .htaccess but if that can’t be done, PHP redirection is the alternative.

Code:

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

Why 301 redirect?  301 redirection is called permanent redirection, so your new URL will be indexed by google not your old one.

301 Redirect – How to create Redirects.

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>