Yesterday I installed LAMP on my Ubuntu 10.04. At first everything seemed fine, but, when I launched my PHP app (I copied it from Windows 7, where I use XAMPP) it didn't accept my .htaccess file. So all of my URLs are broken at the moment.
What I did for .htaccess to work.
1.When I created separate config file in ./sites-available/ I changed Directory section AllowOverride
from None
to All
<Directory /some_path/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
2.Also the first line in my .htaccess file is RewriteEngine On
.
Everything worked fine on Windows in XAMPP. When I launched http://localhost it gave me 500 Internal Server Error. When I change AllowOverride
back to None
, it opens index.html in my root folder and not index.php.
UPD: error.log says about error 500:
[Sat Jun 26 09:40:53 2010] [alert] [client 127.0.0.1] /some_path/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
Could anyone suggest any solution on how to fix it?
error.log
for what caused the 500 error.None
only prevents the symptom of your issue popping up: “When this directive is set toNone
, then .htaccess files are completely ignored. In this case, the server will not even attempt to read .htaccess files in the filesystem.”