开发者

Mod Rewrite condition

Evening,

Can someone help me with the following condition?

RewriteCond   %{HTTP_HOST} ^(.*?\.|)(domain1|domain2|domain3)\.(co\.uk|com)$ [NC]

I want to match all subdomains and no-subdomains, a few domains and a few tlds in my rule. The above rule doesn't work though.

Can someone help? Thanks.

开发者_StackOverflow

Update

RewriteCond   %{HTTP_HOST} ^(.*?\.)?(domain1|domain2|domain3)\.(co\.uk|com)$ [NC]

Works. I need a further exception for domain1.co.uk as that is my primary domain. I'm stuck in an infinite loop. Note I still need to rewrite from domain1.com though.


You can have as many RewriteCond's as you like....

RewriteCond   %{HTTP_HOST} ^(.*?\.)?(domain1|domain2|domain3)\.(co\.uk|com)$
RewriteCond   %{HTTP_HOST} !^domain1\.co\.uk$
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜