Server unable to read htaccess file, denying access to be safe

Saurab picture Saurab · Jul 12, 2015 · Viewed 231.4k times · Source

I have created a simple app using AngularJS. When I tried to host that project in my website http://demo.gaurabdahal.com/recipefinder it shows the following error:

Forbidden

You don't have permission to access /recipefinder on this server. Server unable to read htaccess file, denying access to be safe

But if I go to http://demo.gaurabdahal.com/ it displays "access denied" message as expected, that I have printed. But why is it unable to open that AngularJS projects "recipefinder". If I tried to put a simple HTML app there, it opens just fine.

The same AngularJS project works fine when I host that in github (http://gaurabdahal.github.io/recipefinder)

I can't understand what's wrong.

Answer

swedge218 picture swedge218 · Feb 22, 2017

I had this problem too. My advice is look in your server error log file. For me, it was that the top directory for the project was not readable. The error log clearly stated this. A simple

sudo chmod 755 <site_top_folder>

fixed it for me.