htaccess:将两个相似的 RewriteCond 放在一个中,然后取“所有其他的,而不是那个”
我需要将这两行合并为一行,并将 NOT 放在该行之前。
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /administration/([^/]+)\ HTTP/ [NC,OR]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /administration/\ HTTP/ [NC]
因此,它将是“获取所有不经过这两个 RewriteCond 的所有内容,并排除所有经过这两个 RewriteCond 的内容”。
谢谢。
I need to unite these two lines into one and put NOT before that one.
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /administration/([^/]+)\ HTTP/ [NC,OR]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /administration/\ HTTP/ [NC]
So, it will be "take everything, that doesn't go through that two RewriteCond, and exclude everything that does".
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
下面的解决方案将这两个规则合二为一。
如果你想匹配任何与上面不匹配的内容,那么将其否定
The solution below combines both rules into one.
If you want to match anything that does not match the above then negate it