[Apache] How to Fix a 500 Error After Enabling .htaccess

If Apache isn’t configured to support your site’s .htaccess file, enabling it may cause a 500 Internal Server Error, as shown below:
500

You can usually resolve this issue by making the following changes to Apache’s httpd.conf configuration file.

To help pinpoint the problem, check the logs/error.log file in the Apache installation directory.

1. Enable the mod_rewrite module:
Find and uncomment the following line:

LoadModule rewrite_module modules/mod_rewrite.so

Enable the mod_rewrite module before using rewrite rules in your .htaccess file.

2. Enable the mod_filter module:
If you see the following error:
Invalid command 'AddOutputFilterByType', perhaps misspelled or defined by a module not included in the server configuration

Find and uncomment the following line:

LoadModule filter_module modules/mod_filter.so

3. Enable the mod_deflate module:
If you see the following error:
.htaccess: Unknown filter provider DEFLATE

Find and uncomment the following line:

LoadModule filter_module modules/mod_deflate.so

4. Enable the mod_headers module:
If you see the following error:
.htaccess: Invalid command 'Header'

Find and uncomment the following line:

LoadModule headers_module modules/mod_headers.so

Add a Comment

Your email address will not be published. Required fields are marked *