Apache Rewrite - 如果请求主机不等于xxx.xxx.com并且请求uri相等(/ path1或/ path1 / *)

时间:2016-01-20 20:40:57

标签: apache mod-rewrite url-rewriting rewrite

如果请求主机不等于xxx.xxx.com且请求uri相等(/ path1或/ path1 / *),那么我希望apache忽略所有请求。

基本上我只希望xxx.xxx2.com和xxx.xxx3.com接受该路径的请求

我正在尝试制定规则,但无法使其发挥作用。

# rewriting if request host is not equal to xxx.xxx.com
RewriteCond %{HTTP_HOST}    !^xxx\.xxx\.com
# and request uri is equal ( /path1 or /path1/* )
RewriteCond %{REQUEST_URI}  ^/path1(.*)

# then for all the request, do nothing
RewriteRule ^ - 

0 个答案:

没有答案