.htaccess: URL without "www"
Some people say you shouldn't have two different URLs pointing to exactly the same place, without redirection.
However, it's an esthetic choice to show, or not, the "www" in front of the domain name. So, if you prefer not having the "www", use:
RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
If you rather prefer having the "www", use:
RewriteCond %{HTTP_HOST} !^www.(.*)$ [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
Note that your Apache server should have MOD_REWRITE enabled.
Categories
All articles, Design, E-Commerce, Free stuff, Internal, Mobile, Web, Web Marketing,
Tags
Sparko, Montréal, java, JCCM, médias sociaux, twitter, Agence de développement web, apple, Entrepreneurs, Entrepreneurship, facebook, htaccess, la presse, marketing, médias, publicité, rewriteCond, social media, accents, accesnotaire.com,


Comments
Merab on 26 April 2012 13:05
Write a comment