Skip to content
Web Hosting

Fix "403 Forbidden" on Your Website

403 ForbiddenYou don't have permission to accessAccess denied
7 min read Updated 12 June 2026 ESAGAMES Team

A 403 means the server understood the request but refuses to serve it. The cause is almost always permissions, an .htaccess rule, or a missing index file. Here is how to fix it.

Cause 1: wrong file/folder permissions

Files the web server can't read return a 403. Reset web permissions — folders 755, files 644:

find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;

Cause 2: an .htaccess rule

A Deny/Require rule or a broken rewrite blocks access. Rename .htaccess to test; if the 403 clears, the rule was the cause — regenerate a clean one.

Cause 3: no index file

If a folder has no index.html/index.php and directory listing is off, the server returns 403 instead of showing the files. Add an index file (or enable listing if you intend to show it).

Cause 4: an IP / security block

A firewall, ModSecurity rule or an IP deny-list can 403 specific visitors. Check the server's error log — it names the rule or IP that triggered the block.

The log names the cause

The web server error log says exactly why a 403 happened — a permission, a rewrite, ModSecurity, or an IP rule. Read it before guessing.

403 = refused, not missing. Check permissions (755/644), test .htaccess, add an index file, and read the error log.

Cause 5: ownership mismatch on shared hosting

If files were uploaded via SSH/root and end up owned by a different user than the one PHP-FPM/the web server runs as, that mismatch alone can trigger 403 even with seemingly correct permission numbers. Check ownership with ls -l as well as the mode bits, and chown files to the correct hosting user.

Cause 6: a WAF or CDN rule (e.g. Cloudflare)

A security rule at Cloudflare or another CDN/WAF layer can 403 a request before it even reaches your server. If the error page doesn't look like your server's normal 403 page, check the CDN/WAF dashboard for a firewall event log first.

How to prevent 403 errors

  • Set permissions correctly at upload/deploy time (755 dirs, 644 files) rather than fixing them after the fact.
  • Keep an untouched backup of a known-good .htaccess.
  • Always leave an index file in public folders, or explicitly enable directory listing if that's intended.
  • Review WAF/ModSecurity rule changes before rolling them out broadly.

Related errors

If permissions are the real issue at the OS level, not just the web server, see permission denied on Linux. A 403 that keeps bouncing between pages is usually really a redirect loop, not a permissions problem. For a fatal application error instead of a block, see 500 Internal Server Error.

Hassle-free web hosting

Our web hosting sets sane permissions and a clean DirectAdmin panel on NVMe, with DDoS protection included.

See web hosting
FAQ

Frequently asked questions

What causes a 403 Forbidden error?

The server refuses to serve the request — usually wrong file/folder permissions, a blocking .htaccess rule, a missing index file with directory listing off, or an IP/security (ModSecurity) block.

How do I fix a 403 on my website?

Reset permissions to 755 for folders and 644 for files, test by renaming .htaccess, make sure the folder has an index file, and check the error log for a ModSecurity or IP block.

Why do I get 403 on just one folder?

That folder likely has no index file (and listing is disabled), or its permissions are wrong. Add an index file or fix the folder's permissions to 755.

Can Cloudflare cause a 403 even if my server would allow the request?

Yes — a WAF/firewall rule, bot-fight mode, or a security level set too aggressively at Cloudflare can block a request before it reaches your origin. Check Cloudflare's firewall events log if the 403 page doesn't match your server's usual error page.

Why do I get 403 after restoring a backup?

Backups often restore with the wrong file ownership or overly strict/loose permissions. Re-apply 755 on folders and 644 on files, and confirm ownership matches the hosting user the web server runs as.

Is 403 the same as being IP-banned?

Not necessarily — an IP ban is one possible cause of a 403, but so are permissions, .htaccess rules and a missing index file. Check the server's error log; it names the specific rule or reason.

Further reading

Go deeper on this

Guides and explainers that pair with this fix — from our guides and blog.

Knowledge base

Related articles

Skip the troubleshooting

Managed, protected hosting in Frankfurt — we handle the Linux, the network and the DDoS so you don't have to.

Payments Secure checkout with cards, banking apps and digital wallets.

Choose the payment flow that fits your stack and region without leaving the platform.

Pay by Zen Visa Mastercard Paysafecard PaysafeCash Skrill Trustly Bancontact UnionPay iDeal WebMoney