I’m using html5 boilerplate and I’m trying to test if my htaccess is working properly. When I type in http://www.domain.com into chrome or firefox it does not redirect. I’m thinking maybe this is just some browser gimmick though, similar to how Chrome hides the http:// even though its there.
I have checked using chrome dev tools and firebug, and under the request headers it shows whatever I enter in as the “Host”… both with www. and without it… so I dont really know if its working
# ----------------------------------------------------------------------
# Suppress or force the "www." at the beginning of URLs
# ----------------------------------------------------------------------
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
</IfModule>
The rule is OK.
Please check the following:
RewriteEngine On?<IfModule mod_rewrite.c>to see if it will generate any server errors (indication that mod_rewrite is not loaded).As to www or non — see these topics on Webmasters part of StackExchange: