我正在使用htaccess
AcceptpathInfo On
Options MultiViews
MultiviewsMatch Handlers设置漂亮的URL等等。此文件名中的设置扩展名为可选。例如,http://server.com/index将与http://server.com/index.php相同(在robots.txt.php、style.css.php等方面更有用)。但是在更新新版本的XAMPP (Apache2.4.10和PHP5.6.3)之后,它不能工作(错误403),但是在旧的XAMPP中,它可以工作。你知道有什么替代办法吗?或者如何设置它?错误在线上
Options MultiViews发布于 2014-12-17 22:25:32
实际上,注意到了一些可能解决你问题的东西。因此,在Apache2.4中,每个选项前面都需要一个+或-,所以您需要:
Options +Multiviews如果这仍然不起作用,也许mod_rewrite可以做到(但是您需要尝试每个扩展)。类似于:
RewriteEngine On
# check for PHP extension
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/$1.php -f
RewriteRule ^(.*)$ /$1.php [L]
# chek for HTML extension
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/$1.html -f
RewriteRule ^(.*)$ /$1.html [L]等等,您想要检查的每个分机。
https://stackoverflow.com/questions/27534093
复制相似问题