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$
精彩评论