I mention in my earlier post that you should choose to use www or not , but regardless, stick with it. Another issue that arises is that you can’t always control how someone else will link to your site. While most will include www. others wil not. To insure that all you links are cataloged in the search engines uniformly, you should implement a couple of rules in your .htaccess file.
- A rule to insure www is (or is not) always used. This exmple always adds the www…
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST}!^somewebsite\.com$ [NC]
RewriteRule ^(.*)$ http://www.somewebsite.com/$1 [R=301,L] - A rule to always redirect your home page (index.html, index.php, default.htm, etc) to just root (http://www.yourwebsite.com/)
REDIRECT 301 "index.htm" http://www.somewebsite.com
Thers is a good guide on mod rewrite here at the source.
While it won’t apply to most of the people reading this blog, it is also important not to have multiple views of the same information. So if you have a site with a page of toasters and you give the browser the option to sort by price, color, etc, be sure that the spiders only see one sort of the information.
Response to “Mod Rewrite Rules for Uniform Spidering”
Leave a Reply
You must be logged in to post a comment.
May 30th, 2008 at 11:16 pm
[...] in the search engines uniformly, you should implement a couple of rules in your .htaccess file. (more) Possibly related posts: (automatically generated)Is It January Yet?I’ve been tagged! Posted [...]