Troubleshooting

Fix 403 Forbidden errors on cPanel hosting

Solve 403 Forbidden on a cPanel website: missing index file, wrong permissions, .htaccess deny rules, IP Blocker entries, hotlink protection or ModSecurity blocks.

BeginnercPanel hosting2 min read

A 403 Forbidden error means the server understood the request but refuses to show the page. Unlike a 500 error, nothing crashed; something is deliberately blocking access. On cPanel hosting it is usually a missing index file, permissions, an .htaccess rule or a security block.

Before you start

  • Note whether the 403 appears on the whole site, one folder, or only for you. Ask someone else, or test from mobile data, to find out.
  • Open cPanel → Metrics → Errors: the log line usually names the cause. See read the error log.

Missing index file

If a folder has no index.php or index.html, and directory listing is off, the server returns 403. Log message: Directory index forbidden by Options directive.

  • Upload your site files into the correct document root (check it in cPanel → Domains).
  • Make sure the home page is named exactly index.html or index.php (lowercase).
  • Brand-new addon domains and subdomains show 403 until you upload something.

Wrong permissions

Log message: Permission denied or because search permissions are missing.

  • Folders need 755, files 644. The public_html folder itself is normally 750; do not change it.
  • Fix them in File Manager → Permissions, or in bulk with Terminal. See correct file permissions.

.htaccess rules

Log message: client denied by server configuration.

  • Look for Deny from all, Require all denied or Require ip lines in .htaccess in the folder or any parent folder.
  • Security plugins often add such rules; disable or adjust them.
  • Temporarily rename .htaccess to test.

cPanel security tools

ToolCheck
IP BlockerYour IP or range is in the blocked list
Hotlink ProtectionImages return 403 because a domain is missing from the allow list
Directory PrivacyA cancelled login prompt can end in 401/403
ModSecurityLog shows ModSecurity: Access denied ... [id "..."]

ModSecurity blocks

The web application firewall blocks requests that look like attacks. False positives happen when saving a page with unusual code, uploading certain files, or submitting forms with SQL-like text.

  1. Note the rule id from the Errors log and the URL.
  2. Open a support ticket with both; we can whitelist the rule for your site.
  3. Do not turn ModSecurity off for the whole domain except briefly for testing (cPanel → Security → ModSecurity), as it protects you from real attacks.

Note: If every site and cPanel itself are blocked only for you, the server firewall probably blocked your IP after failed logins. Send us the IP from the IP checker.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.