本文介绍了的RewriteCond%{REQUEST_URI}:如何停止,如果REQUEST_URI含有P =约或P =接触?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图创建.htaccess文件重写条件检查,如果网址包含设置和参数p =约或P =接触的参数p。 在情况下,如果P =约或P =联系,重写规则即低于不应该berformed。 任何人可以帮助我的RewriteCond?
I'm trying to create a rewrite condition in .htaccess file to check if url contains a parameter p that is set and parameter p=about or p=contact. In case, if ?p=about or ?p=contact, the RewriteRule that is below should NOT be berformed. Could anybody help me with RewriteCond?
RewriteCond %{REQUEST_URI} (?p=about_us|?p=contact)
不能正常工作。
does NOT work.
推荐答案下的RewriteCond将匹配如果查询字符串没有一个 P 参数,值为关于我们或联系人即下面的规则将不会执行,如果有AP = 关于我们或联系人
The RewriteCond below will match if the query string does not have a p param with a value of about us or contact i.e the following rule will not execute if it has a p= about us or contact
RewriteCond %{QUERY_STRING} !(^|&)p=(about_us|contact)(&|$) [NC]更多推荐
的RewriteCond%{REQUEST
发布评论