403 Forbidden Error: What It Means & How to Fix It

Key takeaway

A 403 Forbidden error means the server understood your request and refuses to fulfil it: the page exists, but you aren't allowed to see it. The words under the message (nginx, Apache, Cloudflare, Access Denied) name the software that refused you. Visitors can only rule out their side (a VPN, another network, cookies); the block itself is a setting on the site: file permissions, a missing index file, a deny rule or a firewall.

Check it now

403 forbidden error fix guide showing access denied causes and step-by-step solutions
403 forbidden error fix guide showing access denied causes and step-by-step solutions
Start reading
  1. What Is a 403 Forbidden Error?
  2. What a 403 Error Looks Like
  3. 403 vs 401 vs 404: What's the Difference?
  4. Common Causes of 403 Forbidden Errors
  5. How to Fix 403 as a Visitor
  6. 1. Check the URL
  7. 2. Clear Browser Cache and Cookies
  8. 3. Disable Your VPN or Proxy
  9. 4. Try a Different Network or Device
  10. How to Fix 403 as a Site Owner
  11. 5. Fix File and Directory Permissions
  12. 6. Review .htaccess Rules
  13. 7. Add a Default Index File
  14. 8. Disable WordPress Plugins
  15. 9. Check IP Blocking and Firewall Rules
  16. 10. Check HTTPS and Client-Certificate Rules
  17. 11. Fix Cloudflare 403 / Error 1020
  18. 12. Fix Nginx 403 Forbidden
  19. Debugging 403 Errors with HTTP Headers
  20. Does a 403 Error Affect SEO?
  21. How to Prevent 403 Errors
  22. Frequently Asked Questions

What Is a 403 Forbidden Error?

A 403 Forbidden error means the server understood your request and refuses to fulfil it: the page exists, but you are not allowed to see it. Unlike a 404, the server knows exactly what you asked for. If the page shows "nginx" or "Apache" under the message, that is just the software the site runs: the refusal is that site's setting, not your browser.

The HTTP standard, RFC 9110 §15.5.4, defines it in those words: the server "understood the request but refuses to fulfill it". If you sent credentials, the server considers them insufficient, and a client "SHOULD NOT automatically repeat the request with the same credentials". A server may also answer 404 instead, to hide that the page exists at all.

In simple terms: the door exists, but you are not allowed through it. As a visitor you can only rule out your own side; as the site owner you can change the rule.

Is it 403 for everyone? Check from several places

What a 403 Error Looks Like

The words on the 403 page, and the server name under them, tell you which software refused you and so who can fix it:

What the page saysWho refused youWhat it usually means
403 Forbidden with nginx (or nginx/1.27.4, angie, openresty) underneathThe site's nginx server (Angie and OpenResty are nginx-based)A deny rule, a block of your IP, country or VPN, unreadable files, or a folder with no index file
The heading Forbidden and You don't have permission to access this resource. with an Apache/2.4 lineThe site's Apache serverA Require all denied or Deny from rule, often in .htaccess, or file permissions
403 - Forbidden: Access is denied.Microsoft IISFolder permissions, or a sub-status such as 403.4 (HTTPS required)
403 Forbidden with LiteSpeed Web ServerLiteSpeed (common on shared hosting)Host-level security rules, permissions or .htaccess
Sorry, you have been blocked with a Cloudflare Ray IDA Cloudflare WAF rule the site owner setYour request matched a firewall rule: country, IP reputation, a bot rule
Error 1020: Access denied with a Ray IDAnother Cloudflare security featureA blocking rule with no custom page (Cloudflare's docs give API schema and JWT checks as examples)
Access Denied. You don't have permission to access … on this server. Reference #18…Akamai's edge firewallYour IP, network, VPN or request pattern was blocked before reaching the site
403 ERROR. The request could not be satisfied. Generated by cloudfrontAmazon CloudFront / AWS WAFA WAF rule or a country restriction
Your access to this site has been limited by the site ownerWordfence (a WordPress security plugin)The plugin blocked your IP or request; only the owner can unblock it

Whatever the wording, the meaning is the same: this server will not hand you this page. A browser extension or a stale cookie rarely causes it, but your IP address, network or VPN can be the reason for it.

403 vs 401 vs 404: What's the Difference?

These three error codes are often confused. Here is how they differ.

Status CodeMeaningCan You Fix It?Example
401 UnauthorizedYou need to log in firstYes — provide valid credentialsAccessing an admin panel without logging in
403 ForbiddenYou are logged in but not allowedDepends — server is blocking youTrying to access another user's files
404 Not FoundThe page does not existCheck the URL spellingVisiting a deleted or mistyped page

The critical distinction: a 401 error tells you to authenticate. A 403 error tells you that authentication will not help — the server has already decided you cannot access this resource. A 404 means the resource does not exist at all.

If the server rejects the request itself as malformed, for example because of oversized cookies or a broken URL, you get 400 Bad Request instead. If the page exists but doesn't accept the method you used, such as a POST to a page that only serves GET, the answer is 405 Method Not Allowed.

Common Causes of 403 Forbidden Errors

Understanding why a 403 occurs helps you fix it faster. Here are the most common causes, split by whether you are a visitor or a site owner.

  • Incorrect file permissions — files set to 600 or folders to 700 block public access
  • Misconfigured .htaccess rules — deny directives or mod_rewrite rules blocking requests
  • Missing index file — no index.html or index.php, and directory listing is disabled
  • IP blocking — server or firewall rules blocking your IP address or country
  • VPN, proxy or datacenter IP — many sites (streaming, ticketing, adult, banking) block VPN and hosting IP ranges as a policy, and a shared VPN IP may also be on a blocklist
  • Hotlink protection — the server blocks direct linking to images or files from other domains
  • WordPress plugin conflicts — security plugins like Wordfence or iThemes blocking requests
  • Web Application Firewall (WAF) — Cloudflare, Sucuri, or ModSecurity flagging your request
  • HTTPS or client-certificate rules — a server that requires HTTPS (IIS 403.4) or a client certificate (IIS 403.7) refuses requests without one. An expired certificate shows a browser privacy warning instead, not a 403
  • Rate limiting — too many requests from your IP in a short time; most servers answer that with 429 Too Many Requests, some firewalls with 403

How to Fix 403 as a Visitor

If you are seeing a 403 error on a website you do not own, here are the steps to try. These are listed in order — start from the top.

1. Check the URL

The simplest fix is often the right one. Make sure you are visiting a page URL, not a directory URL. Many servers block directory browsing by default.

For example, visiting https://example.com/images/ (a folder) will return 403 on most servers, while https://example.com/images/logo.png (a specific file) works fine. Double-check for typos and ensure the URL points to an actual page.

2. Clear Browser Cache and Cookies

Your browser may be sending outdated cookies or cached authentication tokens that the server is rejecting. Clearing them forces a fresh request.

text
Chrome:  Settings → Privacy → Clear browsing data → Cookies + Cached images
Firefox: Settings → Privacy → Clear Data → Cookies + Cache
Safari:  Settings → Privacy → Manage Website Data → Remove All
Edge:    Settings → Privacy → Clear browsing data → Cookies + Cache

After clearing, close and reopen your browser, then try the URL again.

3. Disable Your VPN or Proxy

VPNs, proxies and Tor send your traffic from shared IP addresses in datacenters. Many sites block those ranges outright (streaming, ticketing, adult and banking sites especially), and a shared IP that someone else abused may be on a blocklist.

Disconnect the VPN and reload. If the page opens, the block is on the VPN's IP: pick a different server, or leave the VPN off for that site. If you're not using a VPN, check your own IP with What Is My IP and its reputation with the IP Blacklist Checker.

4. Try a Different Network or Device

If the 403 persists, switch to a different network (mobile data instead of Wi-Fi, or vice versa). This helps determine if your IP address is being blocked.

You can also try a different device or browser. If the page loads on one browser but not another, the issue is likely related to cached data or browser extensions, not an IP block.

How to Fix 403 as a Site Owner

If visitors are reporting 403 errors on your site — or you are seeing them yourself — the fix is almost always in your server configuration. Work through these checks in order.

5. Fix File and Directory Permissions

Incorrect file permissions are the number one cause of 403 errors on web servers. The standard permissions for a web server are 755 for directories and 644 for files.

Here is what those numbers mean: the first digit is the owner's permission, the second is the group, and the third is everyone else. 7 = read + write + execute, 5 = read + execute, 4 = read only.

bash
# Fix directory permissions (755 = owner rwx, group rx, others rx)
find /var/www/html -type d -exec chmod 755 {} \;

# Fix file permissions (644 = owner rw, group r, others r)
find /var/www/html -type f -exec chmod 644 {} \;

# Verify ownership (should match your web server user)
ls -la /var/www/html/

# Change ownership to web server user if needed
chown -R www-data:www-data /var/www/html/

6. Review .htaccess Rules

On Apache servers, the .htaccess file controls access rules. A single misconfigured line can block all visitors. Check for Deny from all directives or overly restrictive Require rules.

The fastest way to test: rename .htaccess to .htaccess.bak temporarily. If the 403 disappears, the problem is in that file.

bash
# Temporarily rename .htaccess to test
mv /var/www/html/.htaccess /var/www/html/.htaccess.bak

# If 403 goes away, check the file for deny rules:
grep -i 'deny\|require\|allow' /var/www/html/.htaccess.bak

# Common problematic lines:
# Deny from all
# Require all denied
# Order deny,allow

If the site works without .htaccess, review it line by line. Look for Deny from all or Require all denied directives that may be blocking legitimate traffic. Replace them with specific rules that only block what you intend to block.

7. Add a Default Index File

When a visitor requests a directory URL (like example.com/blog/) without specifying a file, the server looks for a default index file. If none exists and directory listing is disabled, you get a 403.

The fix: create an index.html or index.php file in every publicly accessible directory. You can also configure the server to allow directory listing, but this is generally a security risk.

apache
# In .htaccess or Apache config — set default index files
DirectoryIndex index.html index.php index.htm

# If you want to allow directory listing (not recommended for production):
Options +Indexes

8. Disable WordPress Plugins

Security plugins like Wordfence, iThemes Security, Sucuri, and All In One WP Security can trigger 403 errors by blocking requests they consider suspicious. This often happens after a plugin update or rule change.

To test, rename the plugins folder via FTP or SSH to disable all plugins at once.

bash
# Disable all plugins by renaming the folder
mv /var/www/html/wp-content/plugins /var/www/html/wp-content/plugins.bak

# If 403 goes away, re-enable plugins one by one:
mv /var/www/html/wp-content/plugins.bak /var/www/html/wp-content/plugins
# Then deactivate/reactivate each plugin from WordPress admin

If the 403 disappears, re-enable plugins one at a time to find the culprit. Check the plugin's firewall or security logs for blocked requests.

9. Check IP Blocking and Firewall Rules

Your server's firewall or hosting control panel may be blocking specific IP addresses, ranges, or entire countries. This is common with fail2ban, CSF (ConfigServer Security & Firewall), or hosting-level IP blocklists.

Check your firewall rules and server logs to see if legitimate IPs are being blocked.

bash
# Check if an IP is blocked by iptables
iptables -L -n | grep "203.0.113.50"

# Check fail2ban jail status
fail2ban-client status

# Unban a specific IP
fail2ban-client set <jail-name> unbanip 203.0.113.50

# Check Apache deny rules in server config
grep -r 'Deny from\|Require not ip' /etc/apache2/

10. Check HTTPS and Client-Certificate Rules

A 403 tied to TLS happens in two cases: the server requires HTTPS and the request came over plain HTTP (IIS reports this as 403.4, "SSL required"), or the server requires a client certificate the visitor didn't present (IIS 403.7; Apache rules built on SSLVerifyClient). An expired or wrong certificate shows the browser's privacy warning instead, never a 403.

Compare the two schemes for the same URL, and check the certificate itself with DNS Robot's SSL Checker:

bash
# Same page over HTTP and HTTPS: a 403 on one only points at a scheme rule
curl -sI http://example.com/page | head -1
curl -sI https://example.com/page | head -1

11. Fix Cloudflare 403 / Error 1020

Behind Cloudflare, a 403 can come from Cloudflare instead of your server, and its page tells you which feature fired. A WAF custom or managed rule shows "Sorry, you have been blocked"; other security features with a Block action and no custom page show Error 1020: Access denied (Cloudflare's documentation, updated October 2026). Both carry a Ray ID.

Ask the visitor for a screenshot with the Ray ID, then search for it (or their IP) in the dashboard under Security → Analytics → Events: the event names the exact rule. Adjust that rule rather than lowering security everywhere.

  • Security → WAF — review custom rules, check if legitimate paths are being blocked
  • Security → Analytics → Events — find the Ray ID (timestamps are UTC) and see which rule triggered the block
  • Security → Bots — Bot Fight Mode can block legitimate crawlers and API clients
  • Security Level — if set to 'I'm Under Attack', all visitors see a challenge page
  • IP Access Rules — check if your IP or country is accidentally blocked

12. Fix Nginx 403 Forbidden

Nginx returns 403 for several specific configuration issues. The most common: the Nginx worker process does not have read permission on the files, or the autoindex directive is off for a directory without an index file.

nginx
# Check Nginx error log for the exact cause
tail -f /var/log/nginx/error.log

# Common Nginx 403 causes and fixes:

# 1. Permission denied — Nginx runs as 'nginx' or 'www-data' user
# Fix: ensure the user running Nginx can read the files
chown -R nginx:nginx /var/www/html/

# 2. No index file in directory — add to server block:
location / {
    index index.html index.php;
}

# 3. SELinux blocking access (CentOS/RHEL)
setsebool -P httpd_read_user_content 1
# Or set proper context:
chcon -R -t httpd_sys_content_t /var/www/html/

SELinux is a frequently overlooked cause of Nginx 403 errors on CentOS and RHEL systems. Even if file permissions are correct, SELinux may block the Nginx process from reading files. The chcon command above fixes this.

Debugging 403 Errors with HTTP Headers

When you cannot pinpoint the cause, inspect the server's HTTP response headers. They often contain clues about why the request was blocked.

Use DNS Robot's HTTP Header Checker or curl from the terminal to see the full response.

bash
# Check the status line and headers of a 403 page
curl -I https://example.com/restricted-page

# Headers that name the system in the path:
# server: cloudflare + cf-ray: 8f3a...-LAX   → Cloudflare
# server: AkamaiGHost                       → Akamai
# server: CloudFront + x-amz-cf-id          → Amazon CloudFront
# x-sucuri-id                               → Sucuri firewall
# x-iinfo                                   → Imperva
# server: nginx / Apache / LiteSpeed        → the site's own web server

A CDN or firewall header in a 403 means the block happened before the request reached your server, so look in that service's event log; your web server's own name means the rule is in your server config, .htaccess or a plugin.

Does a 403 Error Affect SEO?

Yes, 403 errors can hurt your search rankings if they affect crawlable pages. Google doesn't index URLs that return a 4xx code (429 aside), and removes URLs that were already indexed.

A few 403 errors on intentionally restricted pages (admin panels, private files) are normal and will not affect your SEO. But public pages that return 403 drop out of Google's index.

Search Console's Page indexing report lists these as "Blocked due to access forbidden (403)". Googlebot never sends credentials, so a 403 on a public page means a firewall or bot rule is blocking it.

How to Prevent 403 Errors

Prevention is easier than troubleshooting. Follow these practices to avoid 403 errors on your site.

  • Set correct permissions from the start — 755 for directories, 644 for files, never 777
  • Always have an index file — every public directory needs index.html or index.php
  • Test .htaccess changes — back up the file before modifying, test one rule at a time
  • Monitor your WAF rules — review Cloudflare, Sucuri, or ModSecurity logs weekly
  • Whitelist your own IPs — ensure your office, home, and deployment server IPs are whitelisted
  • Use HTTP Header Checker — regularly check your pages return 200, not 403
  • Set up monitoring — use uptime monitoring to get alerts when pages start returning 403

Is it 403 for everyone, or just you?

Run the page through DNS Robot's free Website Down Checker: it asks from several places at once and shows the status each one gets. A 403 everywhere is the site's rule; a 403 only for you is your network, VPN or IP.

Sources

  1. RFC 9110: HTTP Semantics, §15.5.4 403 Forbidden, IETF
  2. Error 1020 (Cloudflare 1xxx errors), Cloudflare
  3. How HTTP status codes, and network and DNS errors affect Google Search, Google Search Central

Frequently Asked Questions

What does 403 Forbidden mean?

It means the server understood your request and refuses to fulfil it: the page exists, but you are not allowed to see it. RFC 9110 defines it in exactly those terms. Logging in or reloading won't change it unless the site's rule changes.

What does "403 Forbidden nginx" mean?

The site runs on the nginx web server, and nginx refused your request. "nginx" (or a version like nginx/1.27.4) is just its default error page: the block is that site's setting, such as a deny rule, a blocked IP or VPN, or a folder with no index file.

What does "Forbidden" with "You don't have permission to access this resource" mean?

It is the Apache web server's default 403 page. The site's configuration, often a .htaccess rule or file permissions, denies access to that address. As a visitor you can only check your side (VPN, network); the owner has to change the rule.

How do I fix a 403 Forbidden error?

As a visitor: check the URL, turn off your VPN or proxy, try another network, and clear the site's cookies. As the site owner: set folders to 755 and files to 644, make sure each public folder has an index file, and look for deny rules in your server config, .htaccess or firewall.

Does 403 Forbidden mean I am blocked?

Sometimes. If the page opens on mobile data or with your VPN off, your IP or network is blocked. If it fails everywhere and for everyone, the page is restricted or misconfigured. A multi-location checker tells you which in one step.

Why do I get 403 Forbidden with a VPN?

Many sites block VPN, proxy and datacenter IP addresses as a policy, and shared VPN IPs end up on blocklists. Turn the VPN off, or switch to another server; if the site blocks VPNs on purpose, no server setting on your side will get around it.

What is the difference between 403 and 401?

A 401 Unauthorized asks you to authenticate: valid credentials will get you in. A 403 Forbidden refuses you even if the server knows who you are; new credentials only help if the refusal was about them.

Why does Cloudflare show 403 Error 1020?

A Cloudflare security feature the owner configured blocked your request. WAF rules show "Sorry, you have been blocked" instead; 1020 comes from other features with a Block action. Send the owner the Ray ID: they find the rule under Security → Analytics → Events.

What file permissions fix a 403 error?

Directories 755 and files 644, owned by the user your web server runs as. Never 777: it lets anyone on the server change your files. On CentOS and RHEL, check the SELinux context as well.

Can a 403 error affect SEO?

Yes. Google doesn't index URLs that return a 403, and removes ones already indexed. Search Console's Page indexing report lists them as "Blocked due to access forbidden (403)"; make sure firewall and bot rules allow Googlebot.

About the author

Shaik Vahid

Founder of DNS Robot. Vahid spent years in web hosting support fixing domains, DNS records, SSL certificates and email delivery for customers. He builds DNS Robot's tools and writes these guides from the errors people actually hit.

Website Down Checker

Is it down for everyone or just you? Check any site from 11 places and your own connection, with a live screenshot