Search Engine Friendly Redirect Scripts

Previous page | Back to search engine optimization

If you make changes to the structure of your website, the following scripts will help search engines to find your new pages,
and should also help preserve any existing SEO ranking:

PHP Redirect

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

ASP Redirect

<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www.new-url.com/new-page.html"
Response.End
%>

ColdFusion Redirect

<.cfheader statuscode="301" statustext="Moved permanently">
<.cfheader name="Location" value="http://www.new-url.com/new-page.html">

Meta tag Redirect - not SEO friendly

This code is not recommended, since it is not capable of sending the 301 message, but it may be the only
choice if you don't have server side scripting capability.

<html>
<head>
<meta http-equiv="refresh" content="0;url=http://www.new-url.com/new-page.html">
</head>
<body>
This page has moved to <a href=http://www.new-url.com/new-page.html">here</a>
</body>
</html>

 
Back to search engine optimization discussion