You don't even have to leave your chair. Login and vote now.
By dubness
via davidwalsh.name
Published: Jan 08 2008 / 23:32
There are some clear benefits to removing the "www" from your URLs: 1) Shorter URLs. 2) Prevention of Google search engine penalties for duplicate content. 3) Less bandwidth usage if you have many links per page. Luckily, removing the WWW from your page URLs (and subsequent Google listings) can be done inside your .htaccess file so that you wont have to go into every page on your website and remove the "www" from your anchors.
Comments
jp0p replied ago:
I've been doing the opposite for some time now - forcing the www using htacess.
Eric Wendelin replied ago:
Lucky for you this article answers that question too!
amphi replied ago:
Ye, it's a good thing to do. Both should work and one should redirect. It doesn't really matter which one you pick. I went with the non-www one, because that "www." bit is imo amazingly pointless.
leafnode replied ago:
Using RewriteEngine to do this is like using a cannon to shoot a fly. Much "lighter" solution is to make a dummy virtual host and redirect every request using RedirectMatch, like:
<VirtualHost *>
ServerName www.example.com
RedirectMatch 301 (.*)$ http://example.com$1
</VirtualHost>
Or, even lighter, you may use simple redirect to main page (no regexps), but it'd be confusing.
Voters For This Link (19)
Voters Against This Link (0)