apache - 到底如何使友好的 URL 与斜杠一起工作?

标签 apache .htaccess friendly-url seo

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

Options -Indexes

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

当我输入 mydomain.com/file 时没问题,但是当我访问 mydomain.com/file/时出现错误 500。

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

最佳答案

尝试将 -MultiViews 添加到您的选项中。如果它仍然中断,请查看 apache error_log,您将获得对问题所在的完整解释。

关于apache - 到底如何使友好的 URL 与斜杠一起工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5144493/

相关文章:

apache - Tomcat、Mod_rewrite、Mod_proxy : how do I keep the original URI path in a proxied request?

python - 在我的 apache 本地主机 Ubuntu 12.04 中安装 WSGI

php - .htaccess mod 重写规则和符号

php - 使文件扩展名由 PHP 解释

url - DotNetNuke 中的友好 Urls - 疑难解答

php - 使用线程安全或非线程安全的PHP?

html、css文件apache权限

mysql - 数据库连接失败的 Magento 自定义错误页面

apache - URL 重写 - 没有文件扩展名的重定向

.htaccess - 获取漂亮的网址以显示在谷歌搜索中