Search This Blog

&

How to do 301 Redirection?

Friday, October 22, 2010

Need of 301 Redirection
Do you want to change the filename but worried about its current search engine ranking? You just need to do a 301 redirection from old URL to new URL which preserves your old web page rankings. 301 redirection is search engine friendly and treated as permanent redirection in search engine optimization process.

We use different codes for different websites as following.

PHP Redirection Code
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.new-url.com" );
?>

JSP (Java) Redirection Code
<%
response.setStatus(301);
response.setHeader( "Location", "http://www.new-url.com/" );
response.setHeader( "Connection", "close" );
%>

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

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

JSP Redirection Code
<%
response.setStatus(301);
response.setHeader( "Location", "http://www.new-url.com/" );
response.setHeader( "Connection", "close" );
%>

.htaccess Redirection Code
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

I hope that above codes will help you somehow.

0 comments:

Post a Comment