最后如何使友好的 URL 与斜杠一起工作?

发布于 2024-10-19 17:39:57 字数 301 浏览 7 评论 0原文

我的 .htaccess 文件具有当前设置:

Options -Indexes

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1\.php

当我输入 mydomain.com/file 时,一切正常,但是当我访问 mydomain.com/file/ 时,出现错误 500。

没有名为“file”的文件夹,任何路径都会出现此问题。

My .htaccess file has the current setting:

Options -Indexes

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1\.php

When I enter mydomain.com/file it's ok, but when I access mydomain.com/file/ I get error 500.

There's no folder called "file", this problem appears with any path.

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

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

发布评论

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

评论(1

行雁书 2024-10-26 17:39:57

尝试将 -MultiViews 添加到您的选项中。如果仍然出现问题,请查看 apache error_log,您将获得有关问题所在的完整说明。

Try adding -MultiViews to your Options. If it still breaks, look at the apache error_log, you'll get the full explaination of what's going wrong.

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