How to allow websites’ .htaccess files in Apache2?

How to allow websites to use .htaccess files in Apache2 web servers?

The AllowOverride directive controls this: http://httpd.apache.org/docs/current/mod/core.html#allowoverride

To allow AllowOverride in a directory, add the following rules to the /etc/httpd/conf/httpd.conf or similar configuration file for your apache installation:

    <Directory "/var/www/www.example.com">
        Options FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
        AllowOverride All

        Order allow,deny
        Allow from all
    </Directory>

Note that this can be put inside the virtual host configuration block too.

Answered by Eric Z Ma.

Eric Z Ma

Eric is a father and systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

Leave a Reply

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