我有以下重写规则:“^”是什么和“!”意味着在Apache配置?
# Rewriting without query parameters to avoid cache overloading
RewriteCond %{REQUEST_URI} /(en|fr)/search-results.html
RewriteCond %{QUERY_STRING} ^.
RewriteCond %{QUERY_STRING} !referrerPage=automotive-home
RewriteRule ^(.*)/search-results.html$ $1/search-results.html? [NC]
据我了解
RewriteCond %{REQUEST_URI} /(en|fr)/search-results.html
将返回true,如果{REQUEST_URL}
会喜欢:
https://www.trololo.com/en/search-results.html
https://www.trololo.com/fr/search-results.html
请解释最后两个RewriteCond
S:
RewriteCond %{QUERY_STRING} ^.
RewriteCond %{QUERY_STRING} !referrerPage=automotive-home
RewriteCond %{QUERY_STRING} ^.
这是否意味着QUERY_STRING
不是空白%{QUERY_STRING} !referrerPage=automotive-home
这是否意味着QUERY_STRING
不含referrerPage=automotive-home
?
http://httpd.apache.org/docs/2.2/rewrite/intro.html – 2014-12-02 14:09:20
我什么都看不到**!** – gstackoverflow 2014-12-02 14:12:07
仔细一看:'在mod_rewrite中!可以在正则表达式之前使用字符否定它。“ – 2014-12-02 14:12:34