There are some clear benefits to removing the "www" from your URLs:
- Shorter URLs
- Prevention of Google search engine penalties for duplicate content
- Less bandwidth usage if you have many links per page
The .htaccess Code
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]
Conversely, if you'd prefer to use "www" in all of your URLs, you can code:RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
Save some URL characters and remove WWW from your site!
No comments:
Post a Comment