Server error 500 when adding .htaccess file in the root folder
I read a lot of server error 500 questions related to the famous .htaccess file...but I have still not found an answer to this error.
I have a folder whic开发者_JAVA百科h i used to test the .htaccess file.
=>http://localhost/xampp/example/
I copied the .htaccess in the example folder and I get server error 500
I checked in my error.log file and found this: .htaccess RewriteEngine not allowed here
But I changed all AllowOverride None
to AllowOverride All
in my httpd.conf file I also uncommented the line LoadModule expires_module modules/mod_expires.so
error log says: ExpiresActive not allowed here
what is actually happening??...how can I resolve this error??
This is what I have in my .htaccess file now...
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 days"
</ifModule>
I've encountered this error when I've tried to use features of .htaccess not allowed in the Apache AllowOverride
configuration parameter. If you have access to your Apache configuration, try setting this to the level you need, or maybe All
to allow full .htaccess capabilities.
First, Go to your apache’s httpd.conf file I my case its “C:\xampp\apache\conf\httpd.conf”
The lines beginning with # indicate that these are comments Remove the comments for these below mentioned lines
LoadModule deflate_module modules/mod_deflate.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
I had this same problem today. In my case, the problem was because I saved the .htaccess
file with UTF-8 encoding, but I forgot to remove the BOM (byte order mark). When I saved as UTF-8 without BOM, the problem was solved !
精彩评论