的RewriteCond%{REQUEST

编程入门 行业动态 更新时间:2024-10-12 16:26:35
本文介绍了的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

本文发布于:2023-10-31 13:36:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546241.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:RewriteCond   REQUEST

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!