Question
How can I enable htacess Centos apache?
I can’t run .htaccess files on my website. How can I enable it? I am using Centos 7 with apache.
I tried editing /etc/httpd/conf/httpd.conf and added
<VirtualHost *:80>
ServerName example.com
# Disable .htaccess for /var/www directory for security
<Directory “/var/www”>
Allowoverride none
</Directory>
# Enable .htaccess for /var/www/html directory and its subdirectories
<Directory “/var/www/html”>
Allowoverride all
</Directory>
</VirtualHost>
But it doesn’t work..
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×