最后如何使友好的 URL 与斜杠一起工作?
我的 .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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将 -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.