开发者

Apache redirect based on host and uri

I have a fairly simple redirect rule setup in my Apache vhost.

<VirtualHost *:80>
    ServerName mobile.foo.com
    ServerAlias *.foo.com

    RewriteEngine On
    RewriteCond %{HTTP_开发者_如何学PythonHOST} ^(.*)\.foo\.com$
    RewriteRule ^(.*)$ http://mobile.bar.com/foo [R=301,L]
</VirtualHost>

I want to add another condition based on the request uri. The redirect above should not be performed if the request uri equals google.html. I guess another rewrite condition is needed based on the request uri variable. Any ideas on how the regex should look like?


Should look like this:

RewriteCond %{REQUEST_URI} !^/google\.html$
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜