HomeKnowledge Base403 Forbidden / Access Denied
access denied on serverpermission denied server403 forbidden error

How to Fix 403 Forbidden and Access Denied Errors

A 403 Forbidden error means the server understood your request but refused to fulfil it. This guide covers every cause — from file permissions to WAF rules — and gives you step-by-step fixes for each.

What Is a 403 Forbidden Error?

The 403 Forbidden error is an HTTP status code that tells the client: "I understood your request, but I will not allow it." It is distinct from a 401 Unauthorized error, which means authentication is required. A 403 means access is denied even if you are authenticated.

You may see it displayed as:

  • 403 Forbidden
  • Access denied on server
  • You don't have permission to access on this server
  • Permission denied server
  • HTTP Error 403 – Forbidden
ℹ️A 403 is a server-side decision. The server is working correctly — it is actively choosing to deny access based on its configuration.

Common Causes of 403 Errors

CauseWho it affects
Incorrect file/directory permissionsServer owners
Misconfigured .htaccess rulesApache servers
Missing index file in a directoryAll web servers
IP address blocked by server or firewallVisitors with blocked IPs
CDN or WAF blocking the requestSites behind Cloudflare, AWS WAF, etc.
Hotlink protection blocking direct file accessExternal image/file links
Expired or invalid SSL certificate on a restricted resourceHTTPS resources
CMS plugin or security module denying accessWordPress, Joomla, Drupal sites

Client-Side Fixes

If you are a visitor seeing this error, try these steps first:

1. Reload and clear cache

A stale cached response can trigger a 403. Hard-reload with Ctrl+Shift+R (Windows) or Cmd+Shift+R (Mac), then clear browser cache and cookies for the site.

2. Check the URL

A trailing slash or typo can point to a directory without an index file, triggering a 403. Remove or add the trailing slash and try again.

3. Try a different network or VPN

Your IP address may be blocked. Switch to mobile data, a different Wi-Fi network, or a VPN to confirm whether the block is IP-specific.

4. Disable browser extensions

Ad blockers and privacy extensions can sometimes interfere with authentication headers, causing 403 responses. Test in a private/incognito window with extensions disabled.

Server-Side Fixes

If you own the server, these are the most common fixes:

Fix file permissions (Linux)

Web files should be readable by the web server user. Standard permissions are 644 for files and 755 for directories.

# Fix directory permissions
chmod 755 /var/www/html

# Fix file permissions
chmod 644 /var/www/html/index.html

# Recursively fix all files and directories
find /var/www/html -type d -exec chmod 755 {} \;
find /var/www/html -type f -exec chmod 644 {} \;

Check and fix .htaccess (Apache)

A malformed or overly restrictive .htaccess file is a very common cause. Temporarily rename it to isolate the issue:

mv /var/www/html/.htaccess /var/www/html/.htaccess.bak

If the 403 disappears, the issue is in your .htaccess. Review it for Deny from all or Options -Indexes directives.

Add an index file

If directory listing is disabled and there is no index file, the server returns 403. Create one:

echo '<!DOCTYPE html><html><body>Coming soon</body></html>' > /var/www/html/index.html

Check Nginx configuration

# In your server block, ensure the correct root and index are set
server {
    root /var/www/html;
    index index.html index.php;

    location / {
        try_files $uri $uri/ =404;
    }
}
💡After any Nginx config change, run nginx -t to test syntax, then systemctl reload nginx to apply.

CDN and WAF Rules

If your site is behind Cloudflare, AWS CloudFront, or another CDN/WAF, the 403 may be generated by a firewall rule — not your origin server. Check:

  • Cloudflare Firewall Events log for blocked requests
  • AWS WAF sampled requests for matching rules
  • Rate limiting rules that may be triggering on your IP
  • Geo-blocking rules that restrict access by country
  • Bot protection rules that may classify your browser as a bot
⚠️Temporarily bypassing your CDN (by accessing the origin IP directly) can confirm whether the 403 originates from the CDN or the origin server.

Prevention

  • Audit permissions after deployments — automated deployments can reset file permissions. Add a permission-fix step to your CI/CD pipeline.
  • Back up .htaccess before editing — a single syntax error can lock out your entire site.
  • Test WAF rules in simulation mode first — before enabling a new firewall rule in blocking mode, run it in log-only mode to check for false positives.
  • Monitor with Alive24x7 — set up an HTTP monitor on your site. If it starts returning 403, you will receive an instant alert before users notice.

Catch 403 errors before your users do

Alive24x7 checks your site every minute from 13 global locations and alerts you instantly if it returns a 403, 500, or any other unexpected status code.

Start Monitoring Free

Frequently Asked Questions

What is the difference between 401 and 403?

A 401 Unauthorized means authentication is required — you need to log in. A 403 Forbidden means the server knows who you are (or doesn't need to) but is explicitly denying access. You don't have permission to access on this server, regardless of credentials.

Can a 403 error affect SEO?

Yes. If Googlebot encounters a 403 on a page it previously indexed, it will eventually de-index it. If your site's homepage returns 403, it can be removed from search results entirely. Monitor for 403 errors and fix them promptly.

Is a 403 error a server problem or a client problem?

It is a server-side decision, but it can be triggered by client behaviour (e.g., an IP that was blocked after too many failed login attempts). The fix usually requires server-side action.

How can Alive24x7 help with 403 errors?

Alive24x7 monitors your site's HTTP status code every minute. If your site starts returning 403 instead of 200, you will receive an instant alert via email, Slack, or SMS — so you can fix it before it impacts users or SEO rankings.