【发布时间】:2018-02-09 07:24:25
【问题描述】:
我想删除.php 文件扩展名并通过.htaccess 文件添加自定义错误页面。
以下是我的.htaccess文件的完整代码:
RewriteEngine On
#Remove .php file extension
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*[^/])/?$ $1.php [L]
#Use error500.php file located in the root dir
ErrorDocument 500 /error500
删除扩展的第一部分有效,但第二部分无效。它不使用error500.php 文件。我已经尝试添加和不添加 .php 扩展名。
这是我在 apache error.log 中遇到的错误
请求超出了 10 个内部的限制 由于可能的配置错误而重定向。利用 'LimitInternalRecursion' 必要时增加限制。利用 'LogLevel debug' 获取回溯。
我做错了什么?
【问题讨论】:
标签: php apache .htaccess url-rewriting