A 403 Forbidden error is something every web developer has seen at some point. Not only web developers, but even regular people also happen to stumble across this message sometime while browsing the internet.
What is this error? What does it mean? How to fix this? Read on to find out.
What does 403 forbidden mean?
403 is basically an HTTP status/error code. It means that the file or directory you’re trying to access is prohibited for some reason.
There are many reasons this error can pop up in your browser. Webmasters encounter this all the time. The usual fixes include setting the correct file permissions for the required user.
Different web servers report the error in different ways. You’re most likely to see a message stating you don’t have permission to access a particular file/folder or something similar along with 403 forbidden. A sincere web developer, however, will customise the message to fit in with the website’s theme.
Even services like Windows Update might encounter 403 forbidden at times. Again, they have their own way of reporting the error, but it’s the same issue nonetheless.
How to fix the 403 forbidden?
Fortunately, the 403 forbidden is a relatively easy error to fix. There are several methods to fix it –
By checking the .htaccess file
The .htaccess file lies in the public_html folder of the web server provided by your web hosting service. In some cases, corruption of the .htaccess file leads to the 403 forbidden error.
To fix this, delete the .htaccess file (after taking a backup of it) and try reaccessing your website. If it works, the error was caused by the corrupt .htaccess file.
By setting correct permissions
Often when we upload our website to our web server, it sets default permissions for the files. These permissions may or may not allow outsiders to view your websites.
To fix this, modify the website permissions to appropriate access. On Linux web servers this can quickly be done using the chmod followed by an appropriate access code. The most commonly used access codes are 755 and 643 depending upon the file type and how exposed you want it.
Most web hosting providers also provide you with a GUI interface of the server, which means you can set the file permissions by logging in to your web hosting control panel as well.
Also read: How to view HDR videos on Windows 10 PC
By disabling WordPress plugins
If you’re using WordPress, there’s a chance that one or even multiple plugins that you’re using can be causing the 403 forbidden error.
In this case, try turning off all WordPress plugins to see if the website works. Now, if you’re able to access the site, try turning on the plugins one by one to identify the faulty one. You can then set appropriate permissions for the plugin.
By clearing your browser’s cache and cookies
If you’re not a webmaster and still are facing this problem, you can try clearing your browser’s cache. There could be some issues with the cached version of the page which might cause a 403 error.
You could also try deleting cookies. If you frequently log in or out of a particular website, corrupt cookies can cause a 403 forbidden error.
Contact your Internet Service Provider (ISP) or the website directly
If all the ways mentioned above fail, try contacting your ISP. There might be a possibility that your public IP or your ISP is blacklisted. Such a situation can cause a 403 forbidden error on a lot of websites.
You can also try contacting the website tech support if you’re certain the website is online and in working order.
Just check back later
There’s a chance that the website is temporarily down because of maintenance or web server issues. Most developers do put out a message stating that the website is down for maintenance or so. Still, it isn’t a bad idea to just check back on the website later.
Happy Surfing the World Wide Web!