Over the past few months, I’ve noticed several aspects of the website that were damaging our ranking in google. They’ve been fixed, with the fixes ranging from standard to hideously messy. Here they are.
-
Watch out for the ‘www.’ prefix. Most of the time, a website named ‘website.ext’ can be accessed both as ‘website.ext’ and ‘www.website.ext’. Google will think they are two different websites, index your site twice, and thus halve your page rank. I also suspect (but am not sure) that Google will penalize you for content duplication (suspected plagiarism and worthless content in any case). This can be fixed with the following addition to the htaccess file:
RewriteCond %{HTTP_HOST} !^robot.mbhs.edu$ [NC] RewriteRule ^(.*)$ http://robot.mbhs.edu/$1 [L,R=301] -
Watch out for duplicates of individual pages. For simple sites without dedicated serving scripts, this is almost never a problem, since Apache is intelligent enough to do the necessary redirects for you. If, however, you have serving scripts, you may discover that Google has indexed both http://robot.mbhs.edu/contact and https://robot.mbhs.edu/contact/. As noted above, this will decrease your pagerank, and I suspect Google may penalize you for content duplication. Fixing this is more involved, and really depends on your serving script. I managed to fix by adding, to my htaccess, the following:
DirectorySlash off RewriteCond %{REQUEST_FILENAME} -d RewriteCond %{REQUEST_URI} !alumni RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ http://robot.mbhs.edu/$1/ [R=301,L]and then adding to my serve.php:
if(ereg(".+/$",$_SERVER["REQUEST_URI"])) { header("HTTP/1.1 301 Moved Permanently"); header("Location: http://robot.mbhs.edu$betterurl"); return; }I have the special line for ‘alumni’ in the htaccessbecause that is a directory in addition to a page served by my serving script. The ‘$betterurl’ variable is just the url, what those 5 lines of code do is just strip the slash at the end of the url of the served page and cause a 301 redirect.
-
Page aliases cause trouble with links. When designing my serving script, I had thought, “oh, cool, I can make it so that the user can get to a page from multiple URLs! That way, they don’t have to remember they exact URL, and we can make allowances for mistakes!”. Hahaha. Internal links went that way too, which meant that at one point, Google had listed several pages 3 and 4 times. The solution to this is actually pretty simple – just use a 301 redirect in the php script. This is accomplished with:
header("HTTP/1.1 301 Moved Permanently"); header("Location: http://robot.mbhs.edu$betterurl");
Related posts:
#1 by Free SEO at July 20th, 2009
| Quote
Just wanted to agree with you that my website had the same prefix “.www” and non “.www” listing. I found that my website was even taken off search listings all together for my chosen keyword, which definitely hurt my SEO campaign. Thanks for the tips about how to rectify this situation.
#2 by atlanticOptimize at August 2nd, 2009
| Quote
Nice post, you can learn more by doing a Google search for “canonical url.”
#3 by Seo bing at August 10th, 2009
| Quote
I suppose this is with Google only or for Bing also ?
Thanks,
ASHISH THAKKAR
#4 by Scott at August 13th, 2009
| Quote
Most will apply to any search engine, although Google’s stock of patented search engine techniques (including pagrank) does make it rather unique.
#5 by Boca SEO at September 8th, 2009
| Quote
I have my own websites that doesn’t have www before the domain name! I should better check out how badly my rankings plummeted because of this reason. My bad I miss this. Thanks for the the warning.
#6 by Ashish Roy at October 14th, 2009
| Quote
You can use copyscape for seeing if you are duplicating any content. Also, it might be a good strategy to use webmaster tools from Google to see where duplication is happening.