Return to Snippet

Revision: 26580
at May 3, 2010 03:03 by ginoplusio


Initial Code
# add www to any url
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]


# remove www from any url
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.domain\.com [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]

Initial URL
http://www.barattalo.it/2010/05/02/10-htaccess-usefull-tips/

Initial Description
Add and remove www to urls through .htaccess with mod_rewrite

Initial Title
Add and remove www to urls through .htaccess

Initial Tags
htaccess

Initial Language
Other