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?
Apache has an option called “AllowOverride” which allows you to override some Apache settings via a . htaccess file you can place in a directory. In it, you can override PHP settings, create URL rewrites, … Pretty much the basics for every website.
None disables all . htaccess files and directives. This directive is inheritable. This means if you specify AllowOverride none for some directory or virtual host . htaccess files will also be disabled for all subdirectories.
AllowOverride directive is used to allow the use of . htaccess within the web server to allow overriding of the Apache config on a per directory basis.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With