AI News
21 Oct 2026
Read 9 min
How to fix 403 Forbidden error and regain site access
Fix 403 Forbidden error and regain site access quickly by fixing permissions plugins and server rules.
What a 403 means and common causes
Why the server says “Forbidden”
- You are not logged in or lack the right role.
- The file or folder has wrong permissions or owner.
- .htaccess or Nginx rules block access.
- A web application firewall or CDN denies your request.
- Hotlink protection or referrer rules stop media loads.
- The directory has no index file, and listing is off.
- Cookies or cached auth tokens are stale or corrupt.
- SSL or domain mismatch makes the server reject requests.
403 vs 401 vs 404
- 401 Unauthorized: you must log in.
- 403 Forbidden: you are logged in (or not), but the server still blocks you.
- 404 Not Found: the resource does not exist.
How to fix 403 Forbidden error: quick wins
For visitors
- Refresh the page and check the URL for typos or extra slashes.
- Clear browser cache and cookies, or try a private window.
- Log in if the page needs an account. Check that your account has access.
- Disable VPN, proxy, or ad blocker and retry.
- Try a different network or device to rule out an IP block.
For site owners (fast checks)
- Confirm the page exists and has the right link in menus.
- Check your CMS roles. Make sure the content is public if it should be.
- Turn off recent plugins or security modules and test again.
- Review host or CDN firewall events and allow safe traffic.
Owner fixes: permissions, rules, and security
Check .htaccess (Apache) and server rules (Nginx)
- Back up .htaccess. Look for Deny from all, Require all denied, or IP blocks. Comment them out to test.
- Check rewrite rules that block missing referrers or certain user agents.
- On Nginx, review location blocks, allow/deny directives, and try_files rules in your server config.
- Reload the server after changes. Use a staging site when possible.
Fix file and folder permissions
- Folders: 755 is standard. Files: 644 is standard.
- Never set 777. It is unsafe and can break security rules.
- Make the web server user own the files. On Linux that is often www-data, apache, or nginx.
- Apply changes only to needed paths, not the whole server.
Add or correct index files
- If a folder has no index.html, index.php, or default file, servers may return 403.
- Upload an index file or enable listing only if you accept the risk.
Review firewall, WAF, and CDN policies
- Check Cloudflare, Sucuri, or host WAF logs. Whitelist your IP if blocked.
- Disable strict rules (e.g., SQLi/XSS filters) for safe endpoints like admin-ajax if needed.
- Remove country blocks if you serve users there.
- Confirm rate limits are not too low.
Hotlink and referrer rules
- Hotlink protection can block images or videos embedded on other domains.
- Whitelist your own domains and any subdomains or CDNs that should serve media.
Authentication, cookies, and cache
- Force logout and login again if sessions break after a migration.
- Purge server, CDN, and browser caches after permission or rule changes.
- For API routes, send the correct auth headers and CORS settings.
SSL/TLS and domain match
- Make sure your certificate covers the exact host (www vs non-www, subdomains).
- Fix mixed protocol rules. Redirect http to https (or vice versa) in one step to avoid loops and 403s.
CMS and plugin checks
- Security plugins can block IPs, user agents, or URLs. Check their logs and allow good traffic.
- Temporarily disable new plugins or themes that changed rewrite rules.
- Regenerate permalinks in WordPress Settings to refresh rewrite rules.
Server and error logs
- Apache: check error_log and access_log.
- Nginx: check error.log and access.log.
- Search for lines with 403 and the blocked path, user agent, and referrer. This points to the cause.
A simple workflow to diagnose and repair
- Step 1: Reproduce the error in a private window and another network.
- Step 2: Check logs for 403 entries and the exact reason, if listed.
- Step 3: Test with WAF/CDN in “bypass” mode to isolate the network layer.
- Step 4: Restore default .htaccess or Nginx rules and retest.
- Step 5: Set correct file permissions and ownership.
- Step 6: Re-enable security rules one by one. Keep the change that fixes it.
- Step 7: Purge caches and verify with curl or another browser.
Prevention tips
- Use version control for configs. Commit changes and roll back fast if needed.
- Document WAF rules and plugin settings. Avoid overlapping blocks.
- Add uptime monitoring that alerts on spikes in 403 codes.
- Train editors on URL structure and access roles.
- Test changes on staging before pushing to production.
For more news: Click Here
FAQ
Contents