| 301 redirects – On Page – with PHP and ASP |
| Tue, 29 May 2007 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: 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 ?> And in ASP: <% |
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007



