Forward www subdomain to domain
How do I auto forward/turn/convert (whatever the correct term is) URLs entered as www.example.com or www.example.com/blah/blah to example.com or example.com/blah/blah? I basically want to pu开发者_运维知识库sh anything coming in with the www subdomain to forward to the domain including the paths (if any).
In your htaccess file use this
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
精彩评论