开发者

htaccess rewrite rule to external domain if query is with www

www.example.com

to

anotherdomain.com

Calls to example.com (without www.) should NOT be affected on this. Normally this would be easy, but the special thing about this is that I want to execute the same script on a bunch of domains, so I can't put the specific domain-name inside the rewrite-rule.

Do you have any ideas how to do this?

Th开发者_如何转开发anks!


RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://anotherdomain.com/$1 [R=301,L,QSA]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜