Forbidden Access to Website Resources

When you begin developing a website, I know how frustrating it is to encounter plenty of problems, one of those problems you will inevitably encounter is file permission issue. Moreover, you will encounter diaglog box of messages as follows:

Forbidden
You don’t have permission to access this resource.Server unable to read htaccess file, denying access to be safe.

There has been a critical error on your website.
Learn more about debugging in WordPress.
https://wordpress.org/support/article/debugging-in-wordpress/

This page isn’t your-website.com is currently unable to handle this request.
HTTP ERROR 500

If you encounter these similar issues, it can be fixed by modifying file permission, by changing the correct permission to access a file will solve the issue (beware of using 777 file attributes due to vulnerability issue). In most cases, 644 file attributes and 755 folder attributes will work. See changing file permission (this is not limited to WordPress, it can also be applicable to other applications that need to access web files) of WordPress.org.

There are many plenty options to edit or modify file permission on your web files like using FTP and command line interface (CLI) when you have SSH access.

Changing file permission using FTP

Changing file permission via FTP I think will be an easy choice specially you are just starting to build a website. This topic will not be detailed here but I assume you have this idea already.

Changing File Permission via SSH

For slightly advanced user probably SSH access and control probably is also the best option. Executing this command will work in most cases:

Command to change ‘directory’s permission’ recuressively

sudo find path/to/folder -type d -exec chmod 755 {} +

Command to change `file permission` recuresively

sudo find path/to/folder -type f -exec chmod 644 {} +

Just make sure to change path/to/folderto your target folder.

Modifying Index file by echoing plain text will tell you that your web server is actually working, and will let you decide to continue your diagnostics to other folders or files.

Please click to rate!
About

Elvin is one of the contributors of InnoveDesigns.com. He has been creating Wordpress Plugins, Magento Extensions, & Mobile Applications. If you find this article useful, please Follow him on .

Published under Web Development Guide