How to Set AllowOverride all

Munib picture Munib · Sep 11, 2013 · Viewed 528.4k times · Source

I want to set the AllowOverride all But I don't know how to do it. I have found the following code by searching the google and pasted it in .htaccess:

<Directory>
        AllowOverride All
</Directory>

But after pasting it I started receiving "Internal Server Error"

Can anyone guide me where to put this code or how to do it?

Answer

Naveed picture Naveed · Mar 20, 2014

In case you are on Ubuntu, edit the file /etc/apache2/apache2.conf (here we have an example of /var/www):

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

and change it to;

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

then,

sudo service apache2 restart

You may need to also do sudo a2enmod rewrite to enable module rewrite.