开发者

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/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜