Allow Using .htaccess in Apache2

Tiempo de lectura: < 1 minuto

Reading time: < 1 minute

In order to use .htaccess on our Apache server, we need to enable the option in the Apache configuration file.

To do this, we open the file:

sudo vi /etc/apache2/apache2.conf

Once it’s open, we need to go to the line that says AllowOverride None and change it to:

AllowOverride All

And now we need to restart apache2

sudo service apache2 restart

If we still can’t use our .htaccess file, we need to enable the rewrite module

sudo a2enmod rewrite

And restart Apache

If the page gives an error when loading, it means we have an error in the .htaccess file and we need to review it.

Leave a Comment