Knowledgebase

How to fix the 403 Forbidden error on your website

A "403 Forbidden" error means the server understood the request but refused to show the page. On cPanel hosting the cause is almost always one of a few things: wrong file permissions, a rule in .htaccess, a missing index file, or a security rule that blocked your request. This guide helps you fix the 403 Forbidden error by checking each cause in order.

Step 1: Find out who is blocked

  • Open the site from your phone using mobile data (not Wi‑Fi). If it works there, your own IP address is probably blocked by a firewall or by IP Blocker.
  • If the error appears for everyone and on every page, the cause is on the site (permissions, .htaccess or index file).
  • If only one page or action fails (for example saving a post), a security rule such as ModSecurity is the likely cause.

Step 2: Check the error log

In cPanel open Metrics > Errors. It shows the latest error lines for your sites. Messages like "client denied by server configuration", "Permission denied" or "ModSecurity: Access denied" tell you exactly where to look.

Step 3: Fix file and folder permissions

The correct permissions on cPanel hosting are:

  • Folders: 755
  • Files: 644
  • Sensitive config files such as wp-config.php: 640 or 600 are also fine

Never use 777. It does not fix 403 errors and it is a serious security risk. In File Manager, select a file or folder, click Permissions and set the right value. If you have SSH access, you can fix everything inside public_html at once:

cd ~/public_html
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
Careful: run these commands only inside your website folder, not in your home directory, because some files outside public_html (such as mail and SSH files) need different permissions. If you are not sure, ask support to fix the permissions for you.

Step 4: Check the .htaccess file

  1. In File Manager, open public_html and click Settings > Show Hidden Files (dotfiles).
  2. Download a copy of .htaccess as a backup.
  3. Look for lines such as Deny from all, Require all denied or Order deny,allow that block access.
  4. To test, rename .htaccess to .htaccess-old and reload the site. If the 403 disappears, the problem is inside that file.

For WordPress you can create a clean file by going to Settings > Permalinks in the dashboard and clicking Save Changes. The default WordPress rules are:

# BEGIN WordPress
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

Step 5: Make sure there is an index file

If a folder has no index.php or index.html and directory listing is disabled, the server returns 403. Upload your site files to the right place; see How to upload your website (File Manager and FTP). Also check that the domain points to the right document root in Domains.

Step 6: Check security tools

  • IP Blocker: in cPanel, open IP Blocker and remove any address or range you did not mean to block.
  • Hotlink Protection: if it is on and your domain is missing from the allowed list, images may return 403.
  • ModSecurity and the server firewall: if a single action is blocked or your IP is blocked, send support your public IP address and the time of the error, and we will check the logs.
  • Security plugins (WordPress) may block countries or IPs. Disable them temporarily to test.

Frequently asked questions

What is the difference between 403 and 404?

404 means the page does not exist. 403 means it exists but access is refused.

The site works for others but shows 403 for me. Why?

Your IP was likely blocked, often after several wrong passwords for cPanel, email or FTP. Contact support with your IP and we will unblock it.

Can a 403 be caused by Cloudflare?

Yes. If the 403 page shows the Cloudflare logo, check the firewall or security rules in your Cloudflare dashboard.

Need help? Open a support ticket or message us on WhatsApp +20 127 113 3655.

  • 403 forbidden, access denied, file permissions, htaccess, modsecurity, ip blocked, cpanel

Was this answer helpful?

0 Users Found This Useful