.htaccess在localhost上给出500错误

时间:2012-09-02 02:02:56

标签: php apache .htaccess

我是MVC框架的初学者。我正在尝试根据教程创建一个我自己的。

他们提供的

.htaccess文件包含:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA, L]

我收到500服务器错误:服务器遇到内部错误,无法完成您的请求。服务器过载或CGI脚本中存在错误。

我检查了httpd.conf以检查是否没有评论mode_rewrite。有人可以帮我吗?我在Ubuntu 12.04上使用LAMPP

2 个答案:

答案 0 :(得分:3)

RewriteRule ^(.+)$ index.php?url=$1 [QSA, L]

更改为:

RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

注意,“[QSA,L]”与[QSA,L]

重复您的错误,删除空间,工作)。我正在使用WAMP。

答案 1 :(得分:1)

尝试cjriii的答案,如果这不起作用,请检查httpd.conf文件中的AllowOverride变量,并确保它显示All而不是None。这也是我第一次开始使用mod_rewrite时绊倒了我。

相关问题