htaccess:停止所有文件夹中的 htaccess 工作

发布于 2024-12-25 23:41:36 字数 456 浏览 1 评论 0原文

我需要一些关于此 htaccess 代码的帮助

RewriteRule ^([0-9a-z\-\_]+)?$ /index.php?url=$1 [L,QSA,NC]

此代码更改了所有重写网址

/测试帖子名称

/index.php?url=test-post-name

但它影响所有文件夹

意味着

我在这个路径

site.com/vb

中有 vb但 url 应用程序像

site.com/vb/?url=

我该如何解决这个

问题 site.com/vb/index.php site.com/vb

i need some help in this htaccess code

RewriteRule ^([0-9a-z\-\_]+)?$ /index.php?url=$1 [L,QSA,NC]

This code change all rewrite urls from

/test-post-name

/index.php?url=test-post-name

but it affect all folders

mean

i have vb in this path

site.com/vb

but the url apper like

site.com/vb/?url=

how can i fix this

to be
site.com/vb/index.php or site.com/vb

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

黑凤梨 2025-01-01 23:41:36

仅当请求未指向有效目录或文件时才会发生以下重写:

RewriteEngine on
RewriteBase /
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([0-9a-z\-\_]+)?$ /index.php?url=$1 [L,QSA,NC]

要禁用 /vb 文件夹内的任何重写,您可以在其中添加 .htaccess文件夹并打开重写引擎:

RewriteEngine off

The following rewrite will only take place if the request not points to a valid directory or file:

RewriteEngine on
RewriteBase /
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([0-9a-z\-\_]+)?$ /index.php?url=$1 [L,QSA,NC]

To disable any rewrites inside your /vb folder you could add a .htaccess into that folder and turn of the rewrite engine:

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