Quick Tips to Fix ‘error: server unable to read htaccess file, denying access to be safe’

Did you plan to start a new website? Starting a new business or service selling to users is always fascinating, especially when you get appreciation and applause from them as feedback when they like your services. Whenever you are willing to start a website, the first thing you may be needing is the hosting and a domain, and to get it, the quickest way is to go to Godaddy. At the time of starting a site, you may get an ‘error: server unable to read htaccess file, denying access to be safe’ warning.

It happens when you start after getting the domain and hosting. Let’s figure out how you get the warning

How the error shows up?

You may land up in error when you try to use Angular.JS to host an application on your website. You end up with the error warning:

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

This is exactly what you get, which is obviously frustrating. No need to worry as we have the solution to fix the error. Check out the solution

Solution to fix ‘error: server unable to read htaccess file, denying access to be safe’

The reason for the error is setting up a new website on Godaddy with their virtual server. This can land you in the error warning.  

When you start a website, you will be provided with cPanel along with the domain and hosting. Once you have SSH permission to have an access to the server, which is obviously allowed on the cPanel of your site, you can log in to your account. Your account will be in the directory as soon as you log in to your account.

You don’t have all the permissions when you are in the directory as it is set to 150 by default by GoDaddy. To have all the permissions, you need to convert the directory permission to 755.

You need to place the files of your website in the public_html directory.  To do this, you need to follow a few steps

Steps to follow

To make the files of your website publicly accessible and place them in public_html, you the code below

cd public_html

chmod -R o+r *

To make additional subdirectories accessible to read, write, and execute, follow this code

chmod o+rx css
chmod o+rx img
chmod o+rx js

Once you have done till here, the last thing that you will be needing to add .htaccess in the public_hmtl directory. In case, you don’t have your website’s .htaccess file in the public_html directory, then you will not be allowed to load your site according to the GoDaddy rule. The .htaccess file is named vi. htaccess, you need to create the file. The following code can be of great help

Order allow,deny
Allow from all
Require all granted

This works with Apache 2.2 and 2.4. you just need to save the file along with the permission set to 644. To do this, use the below code

chmod 644 .htaccess

Conclusion

With the tips to fix ‘error: server unable to read htaccess file, denying access to be safe’, I hope you can get rid of the error warning. I wish you all the luck!

Reference Source: https://www.anycodings.com/1questions/2866386/server-unable-to-read-htaccess-file-denying-access-to-be-safe

https://exchangetuts.com/server-unable-to-read-htaccess-file-denying-access-to-be-safe-1639883242728981

Leave a Reply

Your email address will not be published. Required fields are marked *