Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 基于主机和uri的Apache重定向_Regex_Apache_Mod Rewrite_Redirect_Rewrite - Fatal编程技术网

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$