Blog

How to resolve a 403 Forbidden error?

You're trying to access a page on your site and you encounter the 403 Forbidden error code ? Don't panic. There are many ways to resolve the issue.

If you don't feel up to fixing the problem yourself, you can call on a web developer who will find the solution for you!

In the meantime, here is a practical guide to help you fix a 403 Forbidden error present on your website.

403 error: what does it mean?

The403 Forbidden error is an HTTP error code meaning “access denied” or “forbidden.” It means the server understood the request sent by the client (for example, a web browser), but refuses to process it because the user does not have the required permissions to access the requested resource.

It can appear in different ways such as:

  • "Error 403 – Forbidden".
  • "Error 403 – Forbidden".
  • "403 Forbidden – Access to this resource on the server is denied".
  • "You are not authorized to view this page".

Unlike to the 404 errors and to 410 errors, which indicate a server issue, the 403 Forbidden error code is not strictly an error but rather an indication that access to the page or requested resource is denied.

Causes of the 403 error

Here are the most common causes of 403 errors on a website.

Access protected content

When a user attempts to access sensitive information that is restricted, a 403 Forbidden error message may appear.

In such a situation, there is no specific method to bypass this restriction. The user does not have sufficient permissions to view the content on the Internet, making it inaccessible.

Browser configuration issue

The issue that can cause the 403 error may be related to the visitor's browser, meaning a client-side problem. This error is often caused by ad-blocking programs or antivirus software that block access to the requested resource.

Page authentication issue

To access certain resources, it may be necessary to authenticate using credentials such as a username and password. If these details are entered incorrectly, a 403 Forbidden error code may be displayed, preventing access to the resource.

Server configuration issue

If an access rights problem is the cause of the 403 error, it is crucial to promptly correct the permissions on the server in order to resolve the issue.

Solutions to resolve a 403 error on a WordPress site

Fix 403 error on WordPress

There are several different steps that can allow you to fix the 403 Forbidden error on a WordPress site.

Check file permissions

File permissions are essential for controlling who can access and perform actions on each file and folder of your website. These are defined by a three-digit number that indicates the permission levels to read, write, and execute files and folders.

If something is wrong with them on your site, it can cause the 403 Forbidden error, which prevents access to the requested resource.

To fix this problem, you can use the FTP/SFTP protocol to view and modify file permissions.

Ideally, for WordPress, files should have permissions 644 or 640, while folders should have permissions 755 or 750. The wp-config.php file should have permissions 440 or 400 according to the WordPress Codex.

You can automatically apply file permissions to all files in a folder by manually setting the permissions for the main folder. Then you can apply the same permissions to the files by manually adjusting the file permissions.

Once you have applied the correct file permissions, you should be able to resolve the 403 Forbidden error and restore access to your website.

Check the .htaccess file

The file .htaccess is used to configure various features such as redirects and access restrictions for your website.

Rather than fixing the .htaccess file directly, an easier solution is to ask WordPress to create a new error-free .htaccess file.

The method to generate a new .htaccess file is to connect to the server via FTP, locate the .htaccess file in the root folder, download a copy to your computer, then delete it from the server. Next, go to "Settings" then "Permalinks" in your dashboard and click "Save Changes."

You don't need to make any changes; just click the button and WordPress will generate a new .htaccess file for you.

Fix 403 error

CDN-related issues

If 403 Forbidden errors appear on resources such as images, JavaScript files, or CSS, it may be due to an issue with your content delivery network (CDN). In that case, it's recommended to temporarily disable your CDN and check whether your site works correctly.

Issues related to site extensions

The problem you are experiencing may be related to one or more extensions WordPress that you are using on your site. This can be due to a bug in a plugin or a compatibility conflict between different plugins.

Whatever the cause, the simplest way to identify the extension causing a problem is to proceed by trial and error.

To do this, you must deactivate all extensions, then reactivate them one by one until you identify the one causing the issue. If you still have access to your dashboard, you can perform this operation from the “Extensions” area.

However, if you cannot access it, you will need to connect to your WordPress site's server via FTP/SFTP. After identifying the extension causing the problem, you have two options: contact the extension developer for help or choose another extension that provides the same functionality.

Check hotlink protection settings

Hotlinking occurs when someone embeds an image from another site using its URL, rather than downloading the image and hosting it themselves. To prevent this, some hosts or CDN providers offer a feature called " hotlink protection ".

When this protection is enabled, it can sometimes return a 403 Forbidden error if a hotlink is detected. That is normal. However, if you encounter a 403 Forbidden error on a resource that should not be blocked, you should verify that hotlink protection is configured correctly.

Solutions to resolve a 403 error on the user side

Most of the time, a 403 error occurs when a user attempts to access a site or page for which they do not have the necessary permissions.

In most cases, it is impossible for the user to fix this error due to access restrictions, server-side issues, or temporary errors.

However, there are a few tricks and settings that can help resolve the 403 error and allow access to the URL in question if access to it is not intended to be blocked.

403 error problem

Clear the cache

If you are facing a browser configuration issue, it may be possible to resolve the problem by clearing the cache and disabling the firewall.

Delete cookies

You can also delete the browser cookies by going to the advanced settings.

Disable your ad blocker

One solution to resolve the 403 Forbidden error code can be to disable your antivirus or to allow access to the site within it.

Try accessing the page from another browser

This solution can help determine whether the 403 error is specific to the browser being used. If the page displays correctly in another browser, this likely indicates a problem with the original browser. In that case, it can be helpful to clear the cache or disable the browser extensions to see if that resolves the issue.

Try accessing the page from another device

If the page doesn't work on another device, this indicates the problem is related to the page or the server, not the original device. In that case, it may help to try refreshing the page or contacting the site owner to see if there's an issue on their end.

If the page displays correctly on another device, this likely indicates a problem with the original device. In that case, you can contact your Internet service provider or check the browser's connection settings.

Check URL

Check that the URL entered is correct and that there are no typos. Generally, URLs have extensions like .com, .fr, or .html. If everything seems correct but the 403 error persists, it is recommended to contact the site's technical support so they can resolve the issue.

Refresh page

If the 403 error is temporary, it may be resolved simply by refreshing the page. To do this, the user can press F5 or click the refresh button in the browser. It is also wise to close the web page and wait a few minutes or even hours.

Contact your ISP

If the site works normally for other customers, it is recommended to contact the Internet service provider (ISP) to report the error and request assistance. The user's IP address may have been placed on a blacklist, which can cause a 403 error. The ISP will be able to provide information and offer appropriate solutions and responses.

Our tip for fixing a 403 error

The 403 errors can sometimes be resolved on the user side, sometimes directly on the site concerned. If you haven't managed to solve the problem, you can always call on a web developer on our freelance platform.

On Codeur.com, you will find professionals who can help you build your site, resolve issues, and create content.