Regex 基于主机和uri的Apache重定向
我在我的Regex 基于主机和uri的Apache重定向,regex,apache,mod-rewrite,redirect,rewrite,Regex,Apache,Mod Rewrite,Redirect,Rewrite,我在我的apachevhost中设置了一个相当简单的重定向规则 <VirtualHost *:80> ServerName mobile.foo.com ServerAlias *.foo.com RewriteEngine On RewriteCond %{HTTP_HOST} ^(.*)\.foo\.com$ RewriteRule ^(.*)$ http://mobile.bar.com/foo [R=301,L] </Virtu
apachevhost
中设置了一个相当简单的重定向规则
<VirtualHost *:80>
ServerName mobile.foo.com
ServerAlias *.foo.com
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.*)\.foo\.com$
RewriteRule ^(.*)$ http://mobile.bar.com/foo [R=301,L]
</VirtualHost>
ServerName mobile.foo.com
ServerAlias*.foo.com
重新启动发动机
重写cond%{HTTP\u HOST}^(.*)\.foo\.com$
重写规则^(.*)$http://mobile.bar.com/foo [R=301,L]
我想根据请求uri添加另一个条件。如果请求uri等于google.html
,则不应执行上述重定向。我想需要基于请求uri变量的另一个重写条件。任何关于regex
应该是什么样子的想法?应该是这样的:
RewriteCond %{REQUEST_URI} !^/google\.html$