Try it on your own data
Every report in this article is in the free plan. One snippet for web and apps, up to 10 sites.
Start freeA 403 Forbidden error means the server understood your request and refuses to fulfill it, usually because of permissions, a server or firewall rule, a location or bot block, or an account without rights. Fix it by finding which layer refused: read the response headers, then origin logs, then CDN events.
What you will learn
- 403 is a refusal, not a missing page; 401 asks for credentials and 404 may be used to hide a resource
- Find the layer first: a request absent from origin logs was stopped by a CDN or firewall
- Google removes URLs that keep returning 403, and a 403 on robots.txt does not stop it crawling
What does a 403 Forbidden error mean?
A 403 Forbidden error means the server understood your request and refuses to fulfill it. That is the definition in RFC 9110, section 15.5.4. The server may say why in the page it returns, but it is not required to. It is not a broken link and not a crash: something made a decision about this request.
The same section adds three details that shape the diagnosis. If you sent credentials, the server considers them insufficient, and a client should not repeat the request automatically with the same ones. A request can also be forbidden for reasons that have nothing to do with credentials. And a server that prefers not to admit a resource exists may answer 404 instead.
You will see it worded many ways: "403 Forbidden", "Access Denied", "You don't have permission to access this resource". The wording comes from whichever layer refused, which is your first clue.
403 vs 401 vs 404: which one are you looking at?
| Code | What the server is saying | Does logging in help? | Typical cause |
|---|---|---|---|
| 401 Unauthorized | No valid credentials came with the request | Often yes | Missing or expired token or session |
| 403 Forbidden | The request is understood and refused | Only with an account that has the right | Permissions, firewall rule, location or bot block |
| 404 Not Found | No current representation, or the server will not disclose one | No | Wrong address or deleted page |
| 451 Unavailable For Legal Reasons | Access is denied because of a legal demand | No | Court order or similar |
| 500 | The server hit an unexpected failure | No | A server error in code or configuration |
A 401 must come with a WWW-Authenticate header naming how to authenticate. If a login prompt would never solve the problem, 403 is the accurate code. 451 is defined separately in RFC 7725. Missing pages and what to do about them belong to how to fix 404 errors.
What should you do if you are a visitor?
- Check the address. A URL that points at a folder rather than a page is a common trigger.
- Sign in, or switch accounts. Many 403 pages mean "you are signed in as someone without access".
- Clear the cookies for that one site. A stale or broken session cookie can make an application refuse you. Clearing everything is rarely needed.
- Turn off the VPN or proxy and try once. Sites block address ranges and countries.
- Try another network or device. If only one network fails, the rule is about your address.
- Contact the site owner with the time, your approximate location, the URL and any reference number on the error page. A firewall block page often prints an identifier that lets the owner find the exact rule.
Repeatedly reloading will not change a permission decision, and may trigger a rate limit on top of it.
What causes a 403 on your own site?
Seven causes cover most cases. They sit in different layers, so the fix depends on finding the layer.
| Cause | Telltale sign | Fix |
|---|---|---|
| File or folder permissions | Error log says permission denied; often right after a deploy or migration | Give the server user read on files and execute on every parent folder |
| No index file in a folder | Only URLs ending in / fail | Add the index file, correct the index setting, or leave listings off on purpose |
Deny rule in the server or .htaccess | Error log says access forbidden by rule or client denied by server configuration | Correct the rule's path or address range |
| Web application firewall | CDN-branded block page; origin logs show nothing | Review the matched rule and add a narrow exception |
| Geographic or IP block | Fails by country or network, works elsewhere | Confirm the block is intended; narrow it |
| Bot rule | Real browsers work, scripts or crawlers fail | Verify the crawler, then allow it explicitly |
| Application or storage authorization | JSON or application page; a specific user or file | Fix the role, policy or object permission |
Object storage has a trap of its own. Amazon S3 returns 403 rather than 404 for an object that does not exist when the caller lacks the s3:ListBucket permission. A "forbidden" image there may simply be a missing file.
In what order should you diagnose a 403?
Work from the outside in, and change nothing until you know which layer answered.
- Reproduce it and capture the response.
curl -s -D - -o /dev/null "https://example.com/path"prints the status and headers. Note theserverheader and any CDN-specific headers. - Read the error page body. Branding and reference numbers identify a CDN or firewall.
- Look in the origin access log. If the request is absent, it was stopped before your server. Cloudflare's documentation says a 403 without its branding comes directly from the origin, and a branded one can come from its WAF rules and other security features.
- If it reached the origin, read the error log. Web servers usually write the reason there even when the page says nothing.
- Vary one thing at a time. Different network, with and without cookies, a browser user agent against your script's, a known good file in the same folder.
- Check what changed. A deploy, a new firewall rule, a permission reset or a migration at the time the first 403 appears is usually the answer.
- Fix the narrowest thing, retest from the failing network, and remove any temporary allowance.
Avoid the shortcut of turning the firewall off or setting folders to 777. The first removes protection from everything; the second lets any account on the machine change your files.
| Step | What you look at | What it tells you |
|---|---|---|
| 1. Capture | Status and response headers with curl | That the code is 403 and which server answered |
| 2. Page body | Branding and reference numbers | Whether a CDN or firewall wrote the page |
| 3. Access log | Is the request there? | Stopped before the origin, or at it |
| 4. Error log | The reason written by the web server | Permissions, missing index or a deny rule |
| 5. Vary one thing | Network, cookies, user agent, file | What the rule is matching on |
| 6. Recent changes | Deploys, rules, migrations | The likely trigger |
| 7. Narrow fix | Retest from the failing network | That nothing else was opened up |
Work from the outside in and change nothing before you know which layer answered.
Worked example: sorting 900 403 responses
Sample data: in one day a site served 80,000 requests, and its CDN events and origin logs together hold 900 responses with status 403, which is 900 ÷ 80,000 = 1.125%.
| Group | Count | Share of 403s | Where it was logged | Verdict |
|---|---|---|---|---|
| Requests for folders with no index, mostly probes | 410 | 410 ÷ 900 = 45.6% | Origin | Correct refusal; leave it |
| Firewall bot rule hitting a verified search crawler | 260 | 260 ÷ 900 = 28.9% | CDN | Wrong; fix first |
| Country block | 150 | 150 ÷ 900 = 16.7% | CDN | Intended; confirm with whoever asked for it |
| Product images after a deploy reset permissions | 80 | 80 ÷ 900 = 8.9% | Origin | Broken; fix now |
| Total | 900 | 100% (rounded shares) |
Only 260 + 80 = 340 of the 900, or 37.8%, need a change. Ranking by count would put harmless probes first. Rank by who was refused and what they were asking for instead: a search crawler on a product page and a customer who cannot load an image matter more than 410 requests for folders nobody links to.
900 responses with status 403 by group
sample dayHow do you fix folder and permission 403s on nginx and Apache?
Folders without an index. nginx handles a request ending in / by looking for an index file, index.html by default. If none exists and directory listing is off, the request is refused, and the error log reports that the directory index is forbidden. Point the index directive at the file you actually have. Switching autoindex on; makes the 403 disappear by publishing the folder listing, which is rarely what you want.
Permissions. The web server runs as its own user. That user needs read permission on the file and execute (search) permission on every folder above it. On Linux, namei -l /var/www/site/images/photo.jpg lists the owner and mode of each step of the path, so you can see where access stops. Grant what is missing to the server's user or group.
Deny rules. In nginx, allow and deny rules are checked in order until the first match, so a broad deny all; placed above an allow wins. In Apache, look for Require directives, including Require all denied inherited from a parent directory. Apache's error log names it: the message reads "client denied by server configuration".
location /admin/ {
allow 203.0.113.0/24;
deny all;
}
The sample block allows one documentation address range and refuses everyone else, which is a 403 working as designed.
When is a 403 intentional, and how do you keep it from misfiring?
Blocking by country or by bot is a legitimate use of 403. The risk is collateral damage.
- Write down why each rule exists and who asked for it. Rules without an owner outlive their reason.
- Verify crawlers before allowing or blocking them. A user agent string is trivial to copy. Search engines publish ways to confirm identity; see how to verify Googlebot.
- Test new firewall rules in a logging mode first where your product offers one, and read the matched requests.
- Check payment callbacks, uptime checks and partner integrations after a rule change. They look like bots because they are.
- Use 451 when the refusal results from a legal demand.
For choosing between blocking, challenging and rate limiting, see bot mitigation.
Does a 403 error hurt SEO?
It can. Google's documentation on status codes says its crawlers treat 4xx errors other than 429 alike: the content is not used, and URLs that were indexed and now return a 4xx are removed from the index over time. So a firewall rule that refuses Googlebot on real pages is a search problem even though visitors notice nothing.
Two further points from Google's documents:
- Do not use 403 to slow crawling. Codes such as 401 and 403 have no effect on crawl rate; for a short overload Google suggests 500, 503 or 429.
- A 403 on
/robots.txtdoes not block crawling. Google treats a 4xx other than 429 on that file as if no robots.txt existed, which means no crawl restrictions.
A 403 on pages that should be private is fine. Make sure those pages are not in your sitemap or linked as public content. To find refused URLs across a site, check URL status codes from outside your own network.
How to see who is getting 403 in TapCub
Take the 340 refusals that need a change. TapCub does not set permissions or firewall rules, and its page script cannot read the status code of the page it runs on. There are two ways to get the evidence in.
- For crawlers, send server records. Import access logs or use server events. Log import keeps only requests classified as bots. Then Web analytics › Bots shows each bot's most common status code on All bots, and the Crawl efficiency tab gives each crawler an error rate, the share of its requests with a 4xx or 5xx. In Monitoring › Crawl health a 403 lowers the success rate, but only 404 and 5xx are listed separately there.
- For people, mark your own 403 page. If your server returns a custom 403 page that carries the TapCub script, send a custom event from it:
<script>
window.__tcq = window.__tcq || [];
window.__tcq.push(['track', 'forbidden_page', { path: location.pathname }]);
</script>
- Read it. The event appears in Web analytics › Events; open its row to see the path values and find which addresses people actually reach. A block page served by a CDN does not carry your script unless you add it, so check the CDN's own events as well.
- Confirm the fix. Note the date in Configuration › Annotations and watch whether the event stops.
FAQ
What does 403 Forbidden mean?
The server understood the request and refuses to carry it out. The reason is usually permissions, a firewall or server rule, a location or bot block, or an account without the needed rights. Unlike a 404, the problem is not that the page is missing, although some servers use 404 to hide that.
How do I fix a 403 Forbidden error as a visitor?
Check the URL, sign in with an account that has access, clear that site's cookies, and try without a VPN or from another network. If it still fails, the decision is on the server side. Send the owner the URL, the time and any reference number shown on the page.
What is the difference between 401 and 403?
401 means the request lacked valid credentials, and the response must say how to authenticate. 403 means the server understood and refuses; if you sent credentials, they are not enough. Retrying the same credentials will not help a 403, while a 401 often resolves after signing in.
Why do I get 403 Forbidden on my whole website?
Check what changed. Common site-wide causes are file permissions reset during a migration, a missing index file in the web root, a deny rule applied to the top directory, or a firewall rule matching every request. The origin error log or the CDN's security events will name which one.
Can a 403 error be caused by a CDN or firewall?
Yes. Firewalls often answer 403 when a managed or custom rule blocks a request. In that case your server never sees it. Compare the error page and headers with your normal ones, search the CDN's security events for the time and address, and adjust only the rule that matched.
Sources
- IETF, RFC 9110: HTTP Semantics, section 15.5.4: 403 Forbidden, June 2022; RFC 7725: 451 Unavailable For Legal Reasons.
- Google, How HTTP status codes affect Google's crawlers and the robots.txt specification. Checked 2026-12-03.
- nginx documentation, ngx_http_access_module and ngx_http_index_module. Checked 2026-12-03.
- Cloudflare, Error 403. Checked 2026-12-03.
- Amazon Web Services, S3 GetObject: permissions and errors; Apache, upgrading to 2.4: access control messages. Checked 2026-12-03.
Was this article helpful?
We use your answers to fix and expand this page.
Couldn’t send. Please try again in a minute.
Thanks for the feedback. We’ll use it to improve this page.You’ve already sent feedback on this page. Thanks.

Technical Engineer
Focuses on tracking code, SDKs, and API integrations, with practical guidance on implementation checks and troubleshooting.



