As a website owner, of course, you want a website that looks beautiful, responsive, and easily accessible. But unfortunately, sometimes technical things appear that can hinder the performance of your website. One of which is a 403 forbidden.
A 403 forbidden error generally indicates a problem with the website. So that the page will stop and prevent the user from continuing any activity. This, of course, is detrimental to the website owner. Because the 403 forbidden cannot be resolved simply by refreshing the web page. So that there is no other choice for visitors but to leave your website.
That’s why you need to know how to deal with 403 forbidden so that the smooth running of the website is maintained. Before we go any further, it’s a good idea to first understand what a 403 forbidden is and what causes it so that you can more easily identify problems that arise and solve them quickly and appropriately.
Table of Contents
What is 403 Forbidden
A 403 forbidden error is an HTTP error status that appears when a website user tries to access a prohibited page or resource. This access restriction occurs because the server reads that there is a protected resource on a website page, so a 403 forbidden appears as a form of protection against that resource .
403 forbidden is generally a blank web page with a small message at the top. Some types of 403 forbidden messages that are often encountered are:
- Error 403
- HTTP 403
- Forbidden: [You don’t have permission to access = [directory] on this server]
- Access denied You don’t have permission to access
- HTTP Error 403 – Forbidden
- 403 Forbidden
- 403 forbidden requests forbidden by administrative rules
Cause 403 Forbidden
Talking about the cause of the 403 forbidden cannot be directly considered as an error. Because 403 forbidden is a warning message sent by the server due to actions that are considered to violate resource security. So if the website owner deliberately sets access permissions to protect a resource, then a 403 forbidden will appear when a user tries to access a prohibited page.
However, of course, it’s a different story if you as a website owner feel that you have never set certain access permissions on your website, but then one of your customers complains because you can’t open the intended page. This can be caused by an error in the access permission settings which makes a page that should be accessible to anyone deemed to have restrictions, and the server automatically protects the page.
If you are currently experiencing the second cause, then you must immediately resolve the problem so that your website can be accessed again. No need to panic, because you can do some quick ways to overcome the following 403 forbidden:
How to Overcome 403 Forbidden
Checking the .htaccess file
The first step you can take to quickly resolve a 403 forbidden is to check the .htaccess file. If you don’t know how to check the file, you can follow these steps:
- Login cPanel then open File Manager
- In the public_html section, you will find the .htaccess file
- If you don’t find the .htaccess file, you can click the Settings menu (located in the upper right corner) and then tick Show Hidden File
- If you still can’t find the .htaccess file, the file may have been deleted, don’t worry because you can immediately create a new .htaccess file.
- After finding the .htaccess file, you can first download the file by right-clicking – download
- When the download is complete, delete the .htaccess file in cPanel
- Try accessing your website again
- If the website can run smoothly again, it can be concluded that the cause of the 403 forbidden is a corrupt .htaccess file, so that after the file is deleted the website can return to normal.
- Next, create a new .htaccess file by logging in to your WordPress dashboard and then opening the Settings menu – Permalinks
- Then click the Save Changes button to automatically create a new .htaccess file.
If you have followed these steps but the 403 forbidden still appears then you can try the second method.
Changing Permissions on Files or Folders
If it turns out that your .htaccess file is not corrupt, the problem may be in the permissions settings. Files and folders have permissions to control who can access the data in them. When you create a new file or folder, the permissions will be automatically generated by default. This is not wrong because the default settings will make your work easier without the need to set file permissions one by one.
However, in this case, the default settings may cause incorrect settings for certain files or folders. Therefore you need to change the permissions of these files and folders. You can do this via an FTP client or File Manager. Filezilla is an FTP client that lets you change file and folder permissions settings. To do this you can follow these steps:
- Use Filezilla to access the website
- cPanel Login
- Right-click on the public_html folder then select File Permissions
- Enter the code “755” in the Numeric Value column
- Select Apply to directories only, then OK
- Try reopening your website, when it’s back to normal it’s a 403 forbidden sign due to an error in the permissions on the file or folder.
If this second method still doesn’t work, you can try the next method.
Deactivating Plugins
After checking the .htaccess file and resetting the file permissions maybe you still haven’t succeeded in removing the 403 forbidden. Don’t give up, you can still try the third way, which is to disable the WordPress plugin. 403 forbidden may appear because there is a problem with the plugin, therefore you need to turn off the plugin so that the website can return to normal. To do this, you can follow these steps:
- Open a hosting account via FTP Client
- Go to the public_html folder then wp-content
- Disable plugins by renaming the plugins folder to disabled-plugins
- Reopen your website, if the website can be accessed normally, it means a 403 forbidden appears due to a problem with the WordPress plugins.
Adding the word disabled- in the plugins folder will disable all plugins on your website. This step aims to determine whether the 403 forbidden is caused by problematic plugins or not. Therefore, even though the website is back to normal, you can’t possibly leave all plugins turned off. So, now you need to take the next step, which is to find out which plugins are the problem.
You can change the folder name back to plugins, then all plugins will be active again. Then rename the more specific plugins one by one by adding the word disabled- in front of it. Every time you change a plugin, try running your website again to check if the 403 forbidden is gone or not. Repeat this step until you find the problematic plugin.
Once the problematic plugins have been found, you can delete them and then reinstall or update to the latest version if any. That way now your website is free from 403 forbidden without disturbing the function of the plugins used.
Conclusion
The 403 forbidden error is a problem that can appear on any website because it is related to access permissions on certain pages or resources. Because of that 403 forbidden can be overcome by checking the .htaccess folder, changing permissions on files and folders, or disabling WordPress plugins.