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:

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/">
        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

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

Eric Ma

Eric is a 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 *