New Site: .htaccess Doesn't Work

  • Posted April 11, 2014

I just transferred a site over to Digital Ocean and all went smoothly except that the .htaccess file doesn’t work whereas it always worked on previous hosts.

I followed these instructions:

… and made the one requested change, but it still doesn’t work. Could this be related to hosting multiple domain names on one droplet? What have I overlooked? Thank you.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Oops, the web form ate up the code. Here is a screenshot:

Zak, <br> <br>You need to edit the AllowOverride directive either in your httpd.conf or vhosts.conf file. <br> <br>If you don’t use a separate vhosts file, then set ‘AllowOverride’ to ‘All’ in httpd.conf: <br> <br># AllowOverride controls what directives may be placed in .htaccess files. <br># It can be “All”, “None”, or any combination of the keywords: <br># Options FileInfo AuthConfig Limit <br># <br> AllowOverride All <br> <br>If you have a separate vhost.conf, then leave httpd.conf unchanged, but add the following lines to every domain in your vhost.conf file: <br> <br><Directory “/home/[username]/public_html”> <br>AllowOverride All <br></Directory> <br> <br>Put it right before </VirtualHost> closing tag and make sure to change the username. <br>

Having the same issue as Biqa, can you tell me what I need to do exactly to provide the right permission to apache? <br> <br>Thanks, <br>Zak

Are you using Apache or Nginx? <br> <br>In Apache you have to set <br>“AllowOverride All” in your main apache conf for the site directory. <br>Also the .htaccess file has to have permissions to be read by apache process (normaly user/group apache/apache or www-data/www-data) <br> <br>Nginx doesn’t use htacess, all configuration are on the server config. <br> <br>You can host the domains you want (apache virtualhosts) in one droplet has long you have resources (CPU, memory, connectivity, etc) for them.