RewriteCond %{REQUEST_URI} :如果 REQUEST_URI 包含 ?p=about 或 ?p=contact,如何停止
我正在尝试在 .htaccess 文件中创建重写条件,以检查 url 是否包含已设置的参数 p 以及参数 p=about 或 p=contact。 如果 ?p=about 或 ?p=contact,则不应执行下面的 RewriteRule。 有人可以帮助我使用 RewriteCond 吗?
RewriteCond %{REQUEST_URI} (?p=about_us|?p=contact)
不起作用。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果查询字符串没有值为
about us
或contact
的p
参数,则下面的 RewriteCond 将匹配,即以下规则不会匹配如果有 ap=关于我们
或contact
则执行The RewriteCond below will match if the query string does not have a
p
param with a value ofabout us
orcontact
i.e the following rule will not execute if it has a p=about us
orcontact