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.
Log in to your cPanel account.
Open the File Manager.
Navigate to the directory containing your website (usually
public_html).Select the files and folders involved in the error.
Click Change Permissions (or "Permissions" in the context menu).
Ensure folders are set to 755 and files are set to 644.
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."
Open the File Manager.
Navigate to the directory where the error occurs.
Verify that an index file exists, such as
index.phporindex.html.Ensure the filename is in lowercase. A file named
Index.htmlorINDEX.HTMLmay 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.
In the File Manager, ensure that "Show Hidden Files" is enabled in the Settings menu.
Locate the
.htaccessfile in your website's root directory.Rename the file to
.htaccess_oldto temporarily disable it.Refresh your website.
If the site loads correctly, the issue is within the
.htaccessfile. You can then open the file and look for lines containingDeny 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.
Check if you have any security plugins (such as Wordfence or Sucuri) active on your site.
Temporarily disable the plugin to see if the 403 error persists.
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.
Clear your browser cache and attempt to load the page again.
Test the URL in an Incognito or Private window.
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.
