This article provides you knowledge about how to properly in seo redirect a web page by the help of an HTTP 301 status code and Location header. The 301 status code is utilized to indicate that a page has enduringly moved.
If you have a dynamically driven web site, you can implement SEO Company India one or more of the following scripts, which depends on which scripting languages you utilize.
These parts of seo code are quite self-skill. They just give the suitable 301 response header and the location of the new page.
Comprise the following ASP code at the top of each page:
<%@ Language=VBScript %>
<%
' Permanent redirection
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "http://www.dexterityunlimited.com/"
Response.End
%>
Comprise the following PHP code at the top of each page:
<?php
// Permanent redirection
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.dexterityunlimited.com/");
exit();
?>
Comprise the following ColdFusion code at the top of each page:
<CFHEADER statuscode="301" statustext="Moved Permanently">
<CFHEADER name="Location" value="http://www.dexterityunlimited.com/">
Comprise the following Java code at the top of each page:
<%
response.setStatus (301);
response.setHeader (“Location", "http://www.dexterityunlimited.com/");
response.setHeader ("Connection", "close");
%>
Comprise the following Perl code at the top of each page:
#!/usr/bin/perl -w
use strict;
print "Status: 301 Moved Permanently\n";
print "Location: http://somewhere/page.htm\n\n";
exit;
If you are on a Microsoft Windows Server or an Apache/ Linux server which can run Apache modules, you can do your redirects with an .htaccess file.
The .htaccess file is an extremely powerful seo tool, but can wreak havoc on a site if not implemented correctly. Always save a backup of any existing .htaccess file before attempting any changes.
The following lines redirect the client to a new location. In this case, a request for the file contact.php is sent to the file contact-us.php:
rewriteEngine on
rewriteRule ^contact\.php$ http://www.dexterityunlimited.com/contact-us.php [R=permanent,L]
The code below will direct the entire traffic that does not seo contain the in the URL to the same page, but now comprising seo the . And this will clean up the canonicalization problem which happens when the version of your site gets indexed along with the version:
rewriteCond %{ HTTP_HOST} ^dexterityunlimited\.com$
rewriteRule ^.*$ http://www.dexterityunlimited.com%{REQUEST_URI} [R=permanent,L]
Have you noticed in your log files that people are looking for index.htm or index.asp in your root folder? Instead of letting them get a 404 Not Found error, why not direct them to your root folder, without a filename:
rewriteRule ^index\.(php|html|htm|asp) http://www.dexterityunlimited.com/ [R=permanent,L]
Have you get grave canonicalization troubles when the secure https version of your site was fully indexed along side your http version? Condition which is your case, there is a way to redirect https for the bots, telling those bots not to index the https version.
SEO Services India Search Engine Optimization India Search Engine Marketing India