Apache: How redirect from domain.com to www.domain.com
Apache: How redirect from domain.com to www.domain.com?
I dont want my users who type domain w/o www to be redicrect to the main www.domain
how to do it开发者_如何学Python and where? local .htaccess or the apache config (I have Ubuntu server)
thanks
.htaccess:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
More info: http://enarion.net/web/htaccess/redirect-www-and-no-www/
精彩评论