.htaccess gives 500 error on localhost

2020-07-17 08:15发布

i'm beginner to MVC framework. I'm trying to create one my own based on tutorials.

.htaccess file that they provide contains:

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

i get 500 server error: The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

I checked httpd.conf to check if mode_rewrite was not commented. Can anyone help me please? i'm using LAMPP on Ubuntu 12.04

2条回答
Lonely孤独者°
2楼-- · 2020-07-17 08:25

Try cjriii's answer and if that doesn't work, check the AllowOverride variable in the httpd.conf file and make sure it says All and not None. That tripped me up the first time I started working with mod_rewrite too.

查看更多
放我归山
3楼-- · 2020-07-17 08:36
RewriteRule ^(.+)$ index.php?url=$1 [QSA, L]

Changed to:

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

Note, "[QSA, L]" vs. [QSA,L]

Duplicated your error, removed space, worked). I'm using WAMP.

查看更多
登录 后发表回答