Skip to main content

How to Troubleshoot a 403 Forbidden Error on a cPanel Website

A 403 Forbidden error indicates that the web server understands the request but refuses to authorize access to the requested page or directory. This article helps cPanel account users identify and resolve common causes of 403 errors on their websites.

A 403 Forbidden error indicates that the web server understands the request but refuses to authorize access to the requested page or directory. This article helps cPanel account users identify and resolve common causes of 403 errors on their websites.

Before you begin

You will need:

  • A cPanel account with access to the website's files and settings.

  • Access to the File Manager or an FTP client.

  • The specific URL where the 403 error is occurring.

Check for incorrect file or folder permissions

Incorrect permissions can prevent the web server from reading your files or executing your scripts.

  1. Log in to your cPanel account.

  2. Open the File Manager.

  3. Navigate to the directory containing your website (usually public_html).

  4. Select the files and folders involved in the error.

  5. Click Change Permissions (or "Permissions" in the context menu).

  6. Ensure folders are set to 755 and files are set to 644.

  7. If you see a directory with permissions like 777, change it to 755.

Check for a missing index file

A 403 error often occurs when a directory does not contain a valid index file, and the server is configured to forbid "Directory Browsing."

  1. Open the File Manager.

  2. Navigate to the directory where the error occurs.

  3. Verify that an index file exists, such as index.php or index.html.

  4. Ensure the filename is in lowercase. A file named Index.html or INDEX.HTML may not be recognized by the server as a default landing page.

Check the .htaccess file for restrictive rules

The .htaccess file can contain instructions that block access to specific IP addresses, directories, or types of requests.

  1. In the File Manager, ensure that "Show Hidden Files" is enabled in the Settings menu.

  2. Locate the .htaccess file in your website's root directory.

  3. Rename the file to .htaccess_old to temporarily disable it.

  4. Refresh your website.

  5. If the site loads correctly, the issue is within the .htaccess file. You can then open the file and look for lines containing Deny from all, Order,Deny,Allow, or specific IP blocks.

Check for IP blocks or security rules

If the error only occurs for certain users or from specific locations, a security tool may be blocking the request.

  1. Check if you have any security plugins (such as Wordfence or Sucuri) active on your site.

  2. Temporarily disable the plugin to see if the 403 error persists.

  3. If the error disappears, the plugin's firewall is likely blocking the request.

Confirm the result

The 403 Forbidden error should no longer appear when you visit the affected URL.

  • The website loads the intended page or directory.

  • The page loads correctly for both local and remote visitors.

If the error persists after checking permissions and .htaccess

If the site still returns a 403 error after you have verified permissions, file names, and the .htaccess file, the issue may be related to a specific server-side configuration or a more complex security rule.

  1. Clear your browser cache and attempt to load the page again.

  2. Test the URL in an Incognito or Private window.

  3. If the error remains, contact Hostek support and provide the specific URL and the time the error occurred so we can investigate the server logs.

Did this answer your question?