停止特定目录的所有 htaccess 规则
我有一个网站 CMS 的目录以及一些 htaccess 规则。 我想知道如何获得忽略特定目录的规则。
这是我所拥有的规则之一的示例,如果您能给我代码,使该规则不适用于目录 example.com/cms/
,那对我确实有帮助。
RewriteCond %{HTTP_HOST} !^example\.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
I have a directory for the CMS of a site and also a number of htaccess rules.
I was wondering how I get a rule to ignore a specific directory.
Here's an example of one of the rules I have, if you could give me the code to make this rule not apply to the directory example.com/cms/
that would really help me.
RewriteCond %{HTTP_HOST} !^example\.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果 cms 目录中没有规则,请在
cms
目录中放置一个.htaccess
文件,其中包含以下内容:If there are no rules in the cms directory, put a
.htaccess
file in thecms
directory with the following: