开发者

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]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜