apache htaccess-在比赛期间重定向循环

发布于 2025-02-06 05:23:58 字数 593 浏览 2 评论 0原文

正如我想我有一个简单的情况...

我在.htaccess文件中有重写,看起来像这样:

RewriteRule ^(?:abc|bca|cab)$ page.html

该规则的目的是将url当url看起来像eg

现在,我必须将其更改为更快,然后对此进行了更改:

RewriteRule ^[^/]+$ page.html

在此规则中,它应该匹配任何不'/'的字符,并且该规则会导致重定向循环。更改之后,我得到了内部服务器错误页面和来自Apache的错误日志:

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace

我尝试添加[L]标志,但没有帮助。 我不知道会发生什么,它应该起作用。

as I suppose I have a simple case...

I had RewriteRule in .htaccess file which looked like this:

RewriteRule ^(?:abc|bca|cab)$ page.html

The goal of this rule was to redirect to page.html when url looks like e.g. http://website.com/abc
and It worked.

Now I have to change it to be more responsive and I made change to this:

RewriteRule ^[^/]+$ page.html

In this rule it should match any characters which are not '/' and this rule leads to redirection loop. After this change I got Internal Server Error page and error log from Apache:

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace

I tried to add [L] flag but It didn't help.
I have no idea what happen, it should work..

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文