UnderHost
Knowledgebase Docs

Fix a 403 Forbidden error: permission denied

A 403 error means the server understood the request but refused to allow access. This UnderHost guide covers permissions, .

On this page

A 403 Forbidden error means the server is reachable but is actively denying access. Unlike a 404 (not found), a 403 means the resource exists but the web server, application, security rule, or upstream proxy is refusing the request. On UnderHost services, start with permissions, .htaccess, security plugins, Cloudflare rules, and any IP blocks configured in your control panel.

Wrong file permissions

File permissions control who can read, write, or execute files. If a directory has no execute permission (e.g. set to 600 instead of 755), the web server can't list or access files inside it, causing a 403.

Fix: Set directories to 755 and files to 644:

$ find ~/public_html -type d -exec chmod 755 {} \;

Or in cPanel → File Manager, right-click a folder → Change Permissions → set to 755.

On VPS or dedicated servers using aaPanel, CloudPanel, DirectAdmin, or another panel, apply the same baseline: directories should normally be 755, public files 644, and private configuration files such as wp-config.php may be stricter.

Don't set folders to 777

777 gives everyone (including scripts) write access. Use 755 for directories and 644 for files. Never use 777 on a production server.

.htaccess rules

An .htaccess rule may be blocking access to specific directories, file types, or IP ranges. Common triggers:

  • A WordPress security plugin added deny rules
  • A rule blocks access to the directory you're trying to reach
  • A hotlink protection rule is blocking a resource

Fix: In File Manager, enable Show Hidden Files and check the .htaccess in the affected directory. Look for Deny from all or Options -Indexes directives. Temporarily rename the file to see if it fixes the 403.

Missing index file

When you visit a directory URL (e.g. yourdomain.com/folder/), the server looks for a default index file (index.html, index.php). If no index file exists and directory listing is disabled, the server returns 403.

Fix: Either add an index file to the directory, or if you want to allow directory listing, add to .htaccess:

.htaccess
Options +Indexes

Note: Only enable directory indexing where you explicitly want visitors to browse folder contents.

IP or country blocked

If only specific visitors get a 403 and your site works for others:

  • Check cPanel → Security → IP Blocker-your IP may be blocked
  • Check your .htaccess for Deny from rules that include the visitor's IP range
  • Check Cloudflare if your domain uses it-a Firewall Rule may be blocking the request
  • Check Wordfence if you use WordPress-it may have flagged the IP

If the 403 started after a or server hardening change, include the affected URL, your public IP, the time it started, and any relevant control panel or Cloudflare rule in your UnderHost support ticket. That gives the support team enough context to check web server logs and account-level restrictions quickly.

Related: Fixing a 500 Internal Server Error | My website is down-what to check first | File Manager in cPanel

Was this article helpful?

Still troubleshooting?

Use UnderHost tools for quick checks, or open a support ticket when the issue needs account or server access.

Related articles

Back to Troubleshooting