Server 500 error while adding .htaccess file to root folder

I read a lot of server errors of 500 questions related to the famous .htaccess file ... but I still have not found the answer to this error.

I have a folder that I used to test the .htaccess file.

=> http://localhost/xampp/example/

I copied the .htaccess file in the example folder and got a 500 server error

I checked in the 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 solve this error?

This is what I have in my .htaccess file ...

 <ifModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 1 days" </ifModule> 
+4
source share
3 answers

I encountered this error when I tried to use .htaccess functions that are not allowed in the Apache AllowOverride configuration parameter. If you have access to your Apache configuration, try setting it to the level you need, or possibly All , to allow full .htaccess capabilities.

+3
source

First go to your httpad.conf apaches file. In my case, its "C: \ xampp \ apache \ conf \ httpd.conf"

Lines beginning with C # indicate that these are comments. Delete comments for the lines below.

 LoadModule deflate_module modules/mod_deflate.so LoadModule expires_module modules/mod_expires.so LoadModule headers_module modules/mod_headers.so 
+2
source

I had the same problem today. In my case, the problem was that I saved the .htaccess file with UTF-8 encoding, but I forgot to delete the specification (byte order of bytes). When I saved UTF-8 without specification, the problem was solved!

0
source

Source: https://habr.com/ru/post/1344624/


All Articles