Getting a 403 forbidden error is a tiresome affair and it disrupts the flow of work. If you are going through this article, chances are that you have come across a 403 error and you do not know how to handle the situation. These kinds of errors prevent or take away your permission to access certain sites or pages over the server. There can be many reasons for an impending 403 forbidden error and the reasons for such an error may vary from time to time and site to site. Even if your hosting company makes some changes to the server, you may find yourself at the receiving end of a 403 error.
What is 403 Forbidden Error?
Before moving forward to tackle such a problem, you must understand what a 403 error is. It is said that when you understand a problem, half the work to solving it is already done. A 403 error represents a status code from HTTP. There are pages and websites over the internet wherein you require some sort of permission to access. If you are trying to access such a site. You will receive the 403 forbidden errors. Different ways in which a 403 error is displayed are listed as follows:
- 403 Forbidden
- HTTP Error 403- Forbidden
- Access Denied. You do not have permission to access it. And so on!
What Causes 403 Errors?
Getting a 403 Forbidden Error while you are working is troublesome becomes it disrupts the flow of work. The simplest reason for getting such an error message is because you are trying to access something over the network to which you do not have any access whatsoever! However, there may be quite a handful of intricate reasons for getting such an error message. The server simply says that you do not have remission to access a certain site but does not elaborate upon it. such an error comes about either because of incorrect permissions for files and folders or because of improper settings loaded into .htaccess files.
How to Fix 403 Forbidden Error?
Now that you understand what a 403 error is, it is time for us to move to how to deal with such errors. Since WordPress has become quite popular over the last few years, we will be discussing solutions that cater particularly to WordPress sites but may be universally applied to help you with your problem.
Method 1: Checking .htaccess Files
There is a chance that you have never seen a .htaccess file before since this is a hidden file. With certain file managers, these files are easily visible or you can also opt for showing hidden files through your computer system. You can also use cPanel or such control panel options to check the .htaccess files. All you have to do is click on the “File Manager” option in cPanel, go to the “public_html” directory, and look for .htaccess files. There is a chance that you may not find the file- in such cases opt for showing hidden files through the “Settings” tab and you are good to go.
Every WordPress site uses the .htaccess file as it is part of the server configuration and functions by changing the Apache Web Server configuration. The file may be unavailable or may be accidentally deleted, and in such cases, this needs to be created manually. Once you get the .htaccess file, you need to do the following things.
- Download this file to the computer system to ensure that there is a backup.
- Remove the original file.
- Try to access the website that was initially not giving access.
- If the website works better, then you can sure that the .htaccess file that you had was corrupted and was malfunctioning.
- In your WordPress dashboard, you have to click on the “Settings” tab. Under this tab, you will find an option called “Permalinks”. You have to go there if you want to create a new .htaccess file.
- Do not make any changes once you open “Permalinks”. You will find a “Save” button at the bottom of the page. Directly click on this button.
- Now you have successfully created a new .htaccess file for your server.
Method 2: Resetting Directory Permission
Sometimes, there is bad permission to the files and folders which hinders access to a site. In such cases, creating a fresh .htaccess file will not help you out. You have to use an FTP client to access the hosting account’s root directory. Here are the steps that are going to help you out if the previous method does not work.
- Get access to your website files through any available FTP client.
- Through this, you have to enter the hosting account’s root directory.
- Choose the folder named “public_html”. It may be available in another name, but you have to choose the folder comprising of all the website files. Right-click on the folder and choose the option named “File Permissions”.
- Herein, you have to check the “Apply” box that is listed alongside directories only. There is a numeric field wherein you have to enter permission “755” and finally click on OK.
- Once the required changes are reflected in the folder you have to repeat the third step.
- You will see an “APPLY’ button in the dialog box, check it and it will ask for a numeric value enter “644”.
- Once done, you can try opening the website and check to see if the problem is resolved or not.
Method 3: Disabling WordPress Plugins (200)
You may find yourself in a situation when both of the above-mentioned steps may not work. This third method is strictly for WordPress sites. The reason the first two methods did not work for you is that you may have installed a plugin that is faulty. Disabling the plugins is helpful in such a case. You can disable one plugin at a time or you can disable all of them at once. It is advisable to disable all of them at once and then allow one at a time.
- Go to the “public_html” folder comprising of all your website data by using any FTP client. The folder name may vary; you have to choose the one containing the installation files for WordPress.
- You have to look for the folder named “wp-content”.
- You have to look for the “Plugins” folder and rename it to something else to keep a track of it.
Once you are done with this step you may check if your website is running or not. If it is running smoothly then the problem was with the plugins. However, if your problem is still not resolved, then it is time that you contact your hosting service provider for some expert advice and solutions.
Such an error message can be very irritating and may even be preventing access to important sites. You do not want to be at the receiving end of such an error message. It can also prevent your access to a site which is important for your work. When you follow the steps that are mentioned in this article you can easily get rid of 403 forbidden error messages. This in turn will help bring loads of traffic to your website.