Tue, 29 May 2007 16:18:42 by Hannah Parker
Sometimes I have to deal with sites where the owner has several domains and they have used server aliasing to point all domains to the same webspace - effectively all domains serve the same content - duplicate content extraordinaire.
Take this scenario. The client has 2 domains:
www.original-domain.co.uk
www.second-domain.co.uk
The original-domain was registered first and the second-domain has a server alias to the original-domain. This means that both domains return a header status of 200 and both show identical content - although they are actually looking at the same copy of the files.
Unfortunately the client wants to promote the second-domain. The original-domain is indexed in Google and the second-domain only has the homepage indexed because it's perceived (fairly so) to be a duplicate site.
So what your friendly SEO team want to do is implement a 301 redirect from orginal-domain to second-domain. Hence telling the search engines that the second-domain is now the site to index.
But then you're hit with an IIS Server with no .htaccess file AND an unco-operative web hosting company - who insist that server aliasing is perfectly SEO friendly. So what do you do....?
Well this solution requires server side scripting to enabled. Because both domains are looking at the same page - you can create the 301 redirect on page - here is the sample PHP script you'd use to solve the issue with the above example domains:
<?php if ($_SERVER['HTTP_HOST'] == "www.original-domain.co.uk") { //redirect header("HTTP/1.1 301 Moved Permanently"); header("Location: www.second-domain.co.uk"); //exit; }
?>
And in ASP:
<% dim domainName domainName=request.ServerVariables("SERVER_NAME") if StrComp(domainName,"www.original-domain.com")=0 then response.Status="301 Moved Permanently" response.AddHeader "Location", "http://www.second-domain.co.uk/" response.End end if %>
Hannah Parker Campaign Delivery Manager |