Seo Articles

RSS Feed - Tag Seo

Why You Didn't Come to the Right Page

Tags: Google, SEO, Apache | on 21/7/08

Update July 30, 2008: The Google crawl appears to be fixed, the search results look good now, so this issue is resolved! Hoorah.

 Update July 23, 2008: There is great discussion going on on Sphinn about this issue.

I was shocked after searching Google today, Google is currently redirecting to my homepage and not the actual page searched for.

google searches go to my homepage and not the page you should get

"Why is this?" I thought to myself.  I tried the url that you should get... http://marcgrabanski.com/pages/code/jquery-ui-datepicker ... ok that works fine.

Now try the old url that has most of the link juice attached to it which has a 301 redirect to the new page... http://marcgrabanski.com/code/ui-datepicker/ ... ok that works fine too.  So what is going on?

First, I go to Google Webmaster and see this, an SEO's nightmare:

Time to check my 301 redirects:

301 redirect jquery ui datepicker

And on another 301 redirect tool:

301 redirect datepicker another time

Well that worked great.  Still, what is the issue?

To make absolutely sure my 301 redirects work, I dumped the text redirects into a htaccess file.  My htaccess code now looks like this:

Apache:
  1. <FilesMatch "\.(htm|html|css|js|php)$">
  2.    AddDefaultCharset UTF-8
  3.    DefaultLanguage en-US
  4. </FilesMatch>
  5.  
  6. RewriteEngine On
  7. RewriteBase /
  8. RewriteRule ^index\.php http://marcgrabanski.com/articles [R=301,L]
  9. RewriteRule ^code\.html http://marcgrabanski.com/pages/code [R=301,L]
  10. RewriteRule ^code/beyond-flash(/?) http://marcgrabanski.com/pages/code/beyond-flash [R=301,L]
  11. # MANY RedirectRules ... ALL WORK FINE
  12.  
  13. RewriteCond %{HTTP_HOST} ^www.marcgrabanski.com$ [NC]
  14. RewriteCond %{REQUEST_URI} !.*tags.php.* [NC]
  15. RewriteRule ^(.*)$ http://marcgrabanski.com/$1 [R=301,L]
  16.  
  17. RewriteCond %{REQUEST_FILENAME}.php -f
  18. RewriteCond %{REQUEST_URI} !/$
  19. RewriteRule (.*) $1\.php [L]
  20. RewriteCond %{REQUEST_FILENAME} !-d
  21. RewriteRule ^(.+)/$ /$1 [R=301,L]
  22.  
  23. RewriteRule    ^$    webroot/    [L]
  24. RewriteRule    (.*) webroot/$1    [L]
  25.  
  26. AddHandler php5-script .php

 

Update July 23, 2008 @1:24AM: I changed all of the Rules to RewriteRule's which has cleaned up most of my 301 redirects.  One issue remains, I need to figure out how to make a RewriteRule to convert:
http://marcgrabanski.com/tags.php?tag=FreeTools
to...
http://marcgrabanski.com/tag/free-tools