Enable Apache2 rewrite module

In order to be able to use rewrite rules in .htaccess file, you shall have Apache2 rewrite module loaded and active.

Run this command to enable module:

sudo a2enmod rewrite

Then go to /etc/apache2/sites-enabled/
Open file 000-default
Find “AllowOverRide” for all the directories you care about (be careful not to overlook any)and change its value from “None” to “All”
Otherwise Apache2 will just ignore your .htaccess file and the rules will not work

Then make Apache2 to reload the new configuration:

sudo /etc/init.d/apache2 force-reload



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.