. Advertisement .
..3..
. Advertisement .
..4..
I get an error
Forbidden
You don't have permission to access /recipefinder on this server. Server unable to read htaccess file, denying access to be safe
when trying to host a simple app using AngularJS in my website. How to fix the server unable to read htaccess file, denying access to be safe error? Please give me some advice.
The cause:
When you set up a new website on a GoDaddy virtual server, there is a problem with it. This is the reason which causes the error: ”server unable to read htaccess file, denying access to be safe”.
Solution:
If you have SSH permission to access to the server (it must be permitted on cPanel), let’s login to your account. After you login successfully, your account will be put in the main directory. Your website’s DocumentRoot is placed in the public html subdirectory. The permissions for this directory are set to 750 by GoDaddy by default, but these permissions are insufficient for Apache to view the files for the website. It’s neccessary to convert the permissions for this directory to 755 (such as chmod 755 public_html).
Then place your website’s files in the public html directory (both rsync and scp are used for copying files to a GoDaddy Linux server).
You have to make sure that all of the files under public html are publicly accessible. Use the following command to do this:
Make sure that additional subdirectories (e.x. css, js, and image) are world accessible by allowing the world access to both read and execute:
Finally, you’ll need a.htaccess file in the public_html directory. If you do not have a.htaccess file in your public_html directory, GoDaddy will apply a rule that prevents the site from loading. This file can be created with vi (“vi .htaccess”). In the file, let’s type the following lines:
This configuration is compatible with both Apache 2.2 and Apache 2.4. Save the file (ZZ), and then check whether it has 644 permissions or not:
This was the same problem that I faced. I suggest looking in the server error log file. It was the fact that the top directory of the project was not accessible. This was clearly indicated in the error log. This is a simple example of a simple
It was fixed for me.