【发布时间】:2013-07-14 12:21:00
【问题描述】:
您好,我正在尝试从 url 中删除 .php 扩展名。为此,我正在关注本教程remove .php extension。但是当我将.htaccess 文件添加到目录时,它会显示
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
我的.htaccess 文件是:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/$ $1.php
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]
怎么了?
注意:我正在 WAMP 服务器中测试我的所有文件。
【问题讨论】:
-
是否启用了 mod_rewrite?
-
你检查过
apache error log使用 wampmanager 菜单查看它像这样left click wampmanager -> Apache -> Apache error log
标签: php .htaccess wamp internal-server-error