开发者

htaccess rewrite rule to external domain if query is with www

开发者 https://www.devze.com 2023-01-31 23:41 出处:网络
www.example.com to anotherdomain.com Calls to example.com (without www.) should NOT be affected on this.
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

精彩评论

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