
A 403 Forbidden error means the server understood the request but refuses to allow access. Unlike a 404, the page may exist; something is blocking it. On websites the usual causes are wrong file or folder permissions, a deny rule in .htaccess, a missing index file with directory listing turned off, a firewall or security plugin blocking your IP or request, or hotlink protection. This guide explains how to find the cause from the error and server logs, and how to fix each one without opening security holes.
- Check the server error log first; it usually names the exact reason.
- Correct permissions are 755 for folders and 644 for files. Never use 777.
- A firewall (ModSecurity, Imunify360, Cloudflare WAF, Wordfence) may be blocking a specific request.
- If only one visitor sees 403, their IP or country may be blocked.
403 forbidden error: if you are a visitor
- Check the URL for typos, especially a folder path without a file name.
- Clear cookies for the site and reload.
- Turn off a VPN or proxy; some sites block VPN IP ranges.
- If it persists, the problem is on the site's side; contact the owner.
Step 1: Read the error log
In cPanel, open Metrics → Errors; in hPanel, check the logs section or the logs folder; on a VPS check /var/log/apache2/error.log or /var/log/nginx/error.log. Messages you may see: Also, this matters for 403 forbidden error on every kind of site.
| Log message | Meaning |
|---|---|
client denied by server configuration | A Require all denied or Deny from rule |
Permission denied: ... unable to read htaccess file | Permissions or ownership are wrong |
Cannot serve directory ... No matching DirectoryIndex | No index.php/index.html and listing is disabled |
ModSecurity: Access denied with code 403 | The web application firewall blocked the request |
directory index of "/path/" is forbidden (Nginx) | Missing index file or wrong index directive |
Fix 1: File and folder permissions
The web server must be able to read files and enter folders. Standard values:
| Item | Permission |
|---|---|
| Folders | 755 |
| Files | 644 |
| wp-config.php or other config files | 440 to 640, depending on host |
Fix in File Manager (select → Permissions) or over SSH:
find ~/public_html -type d -exec chmod 755 {} \;
find ~/public_html -type f -exec chmod 644 {} \;
Files uploaded as another user can also have wrong ownership. Some panels, including Hostinger, have a "Fix file ownership" tool; on a VPS use chown -R user:user ~/public_html with the correct account user.
Fix 2: Check .htaccess rules
Look for rules such as:
Require all denied
Deny from all
Order deny,allow
<FilesMatch ...> Require all denied </FilesMatch>
These are often intentional, for example blocking /data/ or wp-config.php, so remove only the rule that blocks the page you need. A quick test: rename .htaccess to .htaccess-test, reload, then rename it back. In WordPress, re-saving Settings → Permalinks rebuilds the standard rules.
Fix 3: Missing index file
If you visit a folder like /portfolio/ and it has no index.php or index.html, servers with directory listing disabled return 403. Add an index file, or link to the actual page. Do not enable directory listing on a live site; it exposes your file structure.
Fix 4: Firewalls and security plugins
- ModSecurity / Imunify360: blocks requests that look like attacks. Contact your host with the time and URL; they can whitelist the specific rule ID instead of turning the firewall off.
- Cloudflare: check Security → Events for the blocked request and the rule that matched.
- Wordfence and similar: check the blocked IP list and live traffic; you may have locked yourself out after failed logins.
- Country blocking: some sites block whole countries; make sure Pakistan is not blocked if your customers are there.
403 forbidden error: 403 on WordPress admin or uploads
- wp-admin 403: often a security rule restricting admin by IP; your IP may have changed.
- Saving a post gives 403: usually ModSecurity reacting to HTML or code in the content. Ask the host to whitelist that rule for
/wp-admin/post.php. - Images 403: permissions on
wp-content/uploads, or hotlink protection blocking your own domain or CDN.
Fix 5: Hotlink protection
Hotlink protection blocks other sites from embedding your images. If it is misconfigured, it can block your own www or non-www domain, your CDN or Google Images. Add every domain you use to the allowed list in the panel.
403 forbidden error: 403 and SEO
If Googlebot receives 403 on important pages, they drop from the index. Check Search Console's Pages report for "Blocked due to access forbidden (403)" and fix those URLs first. If your firewall blocks Googlebot, verify it is the real Googlebot by reverse DNS and allow it.
403 forbidden error: frequently asked questions
What is the difference between 401 and 403?
401 means you need to log in. 403 means you are not allowed even if you are logged in, or the server refuses for another reason.
Can a 403 be a hack?
Sometimes malware adds deny rules to .htaccess or changes permissions. If you see rules you did not add, run a malware scan; see our WordPress security guide.
Related guides: ERR_TOO_MANY_REDIRECTS, Your Connection Is Not Private Error and There Has Been a Critical Error on This Website.
For official guidance, see MDN Web Docs.
Still seeing 403?
Our support team traces 403 errors through logs, firewalls and server settings. See also our guides to 404 and 500 errors, or contact us.
Written by the ItsWebExpert team, a web design and development company in Karachi building websites, online stores and apps for businesses across Pakistan.
Ask a Question on WhatsApp