停止特定目录的所有 htaccess 规则

发布于 2024-10-07 12:34:15 字数 263 浏览 0 评论 0原文

我有一个网站 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

等待我真够勒 2024-10-14 12:34:15

如果 cms 目录中没有规则,请在 cms 目录中放置一个 .htaccess 文件,其中包含以下内容:

RewriteEngine Off

If there are no rules in the cms directory, put a .htaccess file in the cms directory with the following:

RewriteEngine Off
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文