Home » Website Errors » 403 Forbidden: Why the Server Refuses and How to Let Visitors In
403 Forbidden: Why the Server Refuses and How to Let Visitors In
A 403 Forbidden is a deliberate refusal. The server found what you asked for, checked its rules, and decided not to hand it over. Unlike a 404, the content usually exists. Something in the chain of permissions, configuration or security tooling is saying no.
Step 1: work out how wide the problem is
The pattern tells you where to look:
- Whole site returns 403 → document root permissions, a missing index file, or a server-level block.
- One folder returns 403 → that folder's permissions or an
.htaccessfile inside it. - Only you get 403 → your IP is blocked by a firewall or security plugin.
- Only admin pages or form submissions → a web application firewall (WAF) rule matched the request.
Test from a different network (mobile data works well) to separate "blocked for me" from "blocked for everyone".
Step 2: check file and folder permissions
The web server runs as its own user (often www-data, apache or nginx). It must be able to read files and enter folders. The usual safe values:
| Item | Permission |
|---|---|
| Folders | 755 |
| Files | 644 |
Config files with secrets (e.g. wp-config.php) |
640 or 600, readable by the web server's group or owner |
Reset a site in bulk over SSH:
find /var/www/site -type d -exec chmod 755 {} \;
find /var/www/site -type f -exec chmod 644 {} \;
Also check ownership. Files uploaded as root can be unreadable to the web server even with good permission numbers. On shared hosting, use the control panel's file manager to fix permissions, since you will not have root access.
Step 3: check for an index file
If someone visits a folder (including the site root) and no index.html or index.php exists, many servers refuse with 403 rather than list the folder's contents. See the missing index file guide for the details. Quick check: does the root contain an index file, and is it spelled in lowercase?
Step 4: read .htaccess and server rules
On Apache, one line in .htaccess can block everyone:
Require all denied
Deny from all
Look in the site root and in the folder that fails. Rename .htaccess temporarily to .htaccess-off and reload. If the 403 disappears, the rule set is the cause. Restore it and remove lines one block at a time until you find the culprit.
On nginx, look for deny all; inside location blocks, and check that the root path is correct. Pointing root at a folder nginx cannot read also produces 403.
Step 5: firewalls, CDNs and security plugins
Security layers return 403 when a request looks suspicious:
- Security plugins (Wordfence, iThemes, All In One WP Security) may have locked out your IP after failed logins.
- ModSecurity on the host can block form posts containing code-like text. The host can whitelist the rule.
- CDN firewall rules (Cloudflare and similar) can block countries, user agents or bots. Their event logs show which rule fired.
Most of these keep a log naming the rule ID. Use it rather than turning the whole protection off.
Common mistakes
- Setting everything to
777to "fix" permissions. It makes the site writable by anyone on the server and some hosts refuse to serve such files. - Uploading the site into a subfolder, so the root has no index file.
- Disabling the security plugin entirely instead of unblocking a single IP.
- Forgetting that a CDN may cache the 403 page, so purge its cache after fixing.
Frequently Asked Questions
What is the difference between 401 and 403?
401 means you need to log in and the server will let you try. 403 means the server knows what you asked for and has decided you may not have it, whether or not you are logged in.
Why do I get 403 only from some countries or networks?
A firewall, CDN rule or security plugin is blocking by IP range or country. Check geo-blocking settings and the block log of your WAF or security plugin.
Can a 403 be caused by my browser?
Rarely. Stale cookies from an expired login can trigger it on some sites. Try a private window. If that works, clear cookies for the site.
Found a mistake or still stuck? Contact us. See how we write and check these guides in our editorial policy, or read about DocumentGuy.