重写规则的问题

发布于 2024-09-16 06:10:05 字数 418 浏览 2 评论 0原文

谁能向我解释为什么这个重写规则不起作用:

RewriteRule ^architecture/([a-zA-Z_]+)/(.*).html$ web/index.php?field=1&sub=$1&name=$2

在此网址上: http://localhost/greenlinked1-6.com/architecture/projects/84-test-deeplink-test.html

我应该做什么才能让它工作。 我试图在几篇文章中找到答案,但我无法弄清楚。

Can anyone explain to me why this rewrite rule doens't work:

RewriteRule ^architecture/([a-zA-Z_]+)/(.*).html$ web/index.php?field=1&sub=$1&name=$2

on this url: http://localhost/greenlinked1-6.com/architecture/projects/84-test-deeplink-test.html

And what I should do to get it working.
I've tried to find the answer in several articles but I can't figure it out.

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

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

发布评论

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

评论(2

怼怹恏 2024-09-23 06:10:05

您的 .htaccess 文件应放置在 greenlinked1-6.com 目录中。确保没有冲突的规则,如下所示:

RewriteRule ^(.+)$ $1 [L]
# This line will never be be matched
RewriteRule ^architecture/([a-zA-Z_]+)/(.*).html$ web/index.php?field=1&sub=$1&name=$2

Your .htaccess file should be placed in the directory greenlinked1-6.com. Make sure there are no conflicting rules, like this:

RewriteRule ^(.+)$ $1 [L]
# This line will never be be matched
RewriteRule ^architecture/([a-zA-Z_]+)/(.*).html$ web/index.php?field=1&sub=$1&name=$2
寂寞花火° 2024-09-23 06:10:05

检查您是否没有使用 RewriteBase / 只需删除 &再试一次...

check that u havn't used RewriteBase / just remove & try again...

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