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
<Directory “/var/www”> Allowoverride none </Directory>
<Directory “/var/www/html”> Allowoverride all </Directory> </VirtualHost>
But it doesn’t work…
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Okay I find it… Open /etc/httpd/conf/httpd.conf and search this: AllowOverride controls what And edit AllowOverride to All
Hi @dtorgul,
Don’t worry my dude, Use the following configuration in your Apache Virtual host configuration file.
<VirtualHost *:80>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin webmaster@example.com
ServerName example.com
ServerAlias www.example.com
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /var/www/html/example.com/public_html
<Directory /var/www/html/example.com/public_html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
# Log file locations
LogLevel warn
ErrorLog /var/www/html/example.com/log/error.log
CustomLog /var/www/html/example.com/log/access.log combined
</VirtualHost>
Please specify the exact location of website root directory (/var/www/html/example.com/public_html) in the configuration.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.