A 403 Forbidden Error is a an error that usually occur when trying to access a url.
When trying to access a URL that has a restriction set by the website owner, or if your IP address has been blocked, it normally result to a 403.
When building websites, I usually encounter a 403 error after doing some editing via a FTP client. in my case, it always restriction on the folder am trying to access that result in such error.
How To Fix 403 Forbidden Error
Check if your IP is blocked
Unblock or remove all IP addresses. try refresh the error prone webpage and see if it still displaying 403 forbidden.
Change Folders And Files Permission
Another causes of 403 is lack of appropriate files and folder permission. if the above solution didn’t work for you, this should.
Check and make sure all files have CHMOD value of 644 and folders 755.
If after chmoding the files and folder to 644 and 755 respectively and it still didn’t work, you need to CHMOD all the folders inside the “public_html” folder to 777. that should do the magic.
From my experience, CHMODing all folder to 777 sometimes doesn’t work. in such scenario i change the permission of the “public_html” from it default 750 to 777 and it will eliminate the 403 error.
NOTE: If the website is now stable and the 403 forbidden error no longer raise its ugly head, you need to revert all files and folder permission to 644 and 755.
if public_html permission was change, you need to chmod it to its default 750 value.
For those that don’t know how to CHMOD or change file or folder permission, follow the steps below.
- Login to cPanel via http://yoursite.com/cpanel
- Click file manager under file section
- In the file manager page, under Perms tab, you will see all the file and folder permission
- To change the file permission, double-click to change.