Design and Development > PHP

301 Redirect using PHP - Permanent Redirect HTTP 301

(1/1)

Kevin:
You can set 301 redirection (Permanent Redirection) using the below PHP code. It helps to search engines to redirect to the new web site:


--- Code: ---<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.location-to-new-web-site.com" );
?>

--- End code ---
Kevin

muckle.martin:
Thanks for sharing. Is HTTP/1.1 necessary? I think a Location header would be good enough. Because this might also work with HTTP/1.0 clients.


--- Quote from: "Kevin" ---You can set 301 redirection (Permanent Redirection) using the below PHP code. It helps to search engines to redirect to the new web site:


--- Code: ---<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.location-to-new-web-site.com" );
?>

--- End code ---
Kevin
--- End quote ---

Navigation

[0] Message Index

Go to full version