Wednesday, April 18, 2012

301 Redirects on r00tb0x.com

In an SEO attempt to produce backlinks on jamesattard.com while not losing any ranking due to duplicate content, I am explicitly redirecting search engines which crawl on r00tb0x.com to jamesattard.com. The redirection is permanent (301), and this will make sure that the search engine will drop off duplicates.

For your information, the Rewrite Rule I am using is the following:

RewriteCond %{HTTP_HOST} r00tb0x.com [NC]
RewriteCond %{HTTP_USER_AGENT} .*(Googlebot|Bingbot).*
RewriteRule (.*) http://www.jamesattard.com [R=301]

Notice the two chained rewrite conditional statements which have an effect only on Google and Bing bots. To test that this redirection is working on bots but not on humans, I used curl as illustrated in a previous post:
ivory:~ user$ curl -A "Googlebot" r00tb0x.com
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved 
<a href="http://www.jamesattard.com">here</a>.</p>
</body></html>
ivory:~ user$ curl r00tb0x.com
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved 
<a href="http://www.r00tb0x.com/">here</a>.</p>
</body></html>
Post a Comment