Sunday, April 24, 2011

htaccess SEO

I'm going to show you some good htaccess SEO tricks in this post.
If you really want to get some good Page Rank then all the crawl errors that you see in te Google Webmaster Tools should be corrected.
Most of these errors are 404 (Not found) errors, meaning that there are link to pages in your site that doesn't exist anymore, maybe because the url changed or they were deleted.

With these htaccess SEO tricks you can easily correct some errors and improve SEO on your website

  1. # Eliminate the /folder-name from directory from url
      RedirectMatch 301 /folder-name/
  2. # Rename the /old-name directory to new-name
      RewriteRule ^old-name/(.*)$ /new-name/$1 [R=301,L]

  3. Feedburner redirect
    RewriteCond %{HTTP_USER_AGENT} !FeedBurner.*
    RewriteRule ^rss.xml$ [R=temp,L]

  4. Setting preferred domain with starting with www
    RewriteCond %{HTTP_HOST} ^
    mydomain\.com$ [NC]
    RewriteRule ^(.*)$ http://www.$1 [L,R=301]

  5. Redirect to new domain
    %{HTTP_HOST} ^([^.:]+\.)*oldwebsite\.com\.?(:[0-9]*)?$ [NC]
    ^/(.*)$$1 [R=301,L]
  6. Redirect one single page (with no extension):
    RewriteRule ^my-old-page$ [R=301,L]
  7. Url rewriting: Rewriting to
    RewriteRule ^([a-zA-Z0-9_-]+)$ article.php?n=$1
    RewriteRule ^([a-zA-Z0-9_-]+)/$ article.php?n=$1

    (Don't forget to make a backup of your old htaccess file fisrt, just in case)


Post a Comment

Your opinion is very appreciated, thank you!