New Site: .htaccess Doesn't Work

April 11, 2014 4.6k views
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.
4 Answers
Are you using Apache or Nginx?

In Apache you have to set
"AllowOverride All" in your main apache conf for the site directory.
Also the .htaccess file has to have permissions to be read by apache process (normaly user/group apache/apache or www-data/www-data)

Nginx doesn't use htacess, all configuration are on the server config.

You can host the domains you want (apache virtualhosts) in one droplet has long you have resources (CPU, memory, connectivity, etc) for them.
Having the same issue as Biqa, can you tell me what I need to do exactly to provide the right permission to apache?


You need to edit the AllowOverride directive either in your httpd.conf or vhosts.conf file.

If you don't use a separate vhosts file, then set 'AllowOverride' to 'All' in httpd.conf:

# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
AllowOverride All

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:

AllowOverride All

Put it right before closing tag and make sure to change the username.
Oops, the web form ate up the code. Here is a screenshot:
Have another answer? Share your knowledge.