Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4862 pages

Help for owners

Visitors get a 403 Forbidden error instead of my website

Short answer

When your website shows 403 Forbidden, the server received the request and refused to serve it. The usual reasons are access rules that block some visitors, a missing home page file, or files the web server is not allowed to read. Logging in again does not help, because the refusal comes from the server's rules.

  • Written for business owners
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Does this sound like your situation?

  • The home page shows 403 Forbidden but some inner pages still open.
  • The 403 began once the site was copied over to another server.
  • Customers in one country or office see the error and I do not.
  • Uploaded images and PDFs return 403 while pages load.
  • A security plugin or firewall was switched on shortly before it began.

Why does this happen?

  1. The server understood and said no

    MDN defines 403 Forbidden as the server understanding the request but refusing to process it. Unlike a 401 error, authenticating or authenticating again makes no difference, so the cause sits in the site's permissions or rules.

  2. An access rule blocks the visitor

    Web servers can allow or deny visitors by address, host name or other conditions. Apache's access control guide shows rules that keep a given IP address or domain from seeing content, and its rewrite rules can send a 403 Forbidden response on purpose. Security plugins and firewalls write rules like these, sometimes broader than intended.

  3. No home page file where the server looks

    When someone asks for a folder, the server looks for an index file such as index.html or index.php. If none is there and folder listings are switched off, nginx and Apache answer with 403. A move that missed a file or changed the web root often causes this.

  4. File or folder permissions are wrong

    After a migration or a manual upload, files can end up owned by the wrong user or readable only by their owner. The web server then refuses them, which is why images or downloads fail while other pages work.

What can I do about it today?

  1. Note who sees it and whereCheck from your phone on mobile data and ask someone in another place. A 403 for some people only points at an access rule, while a 403 for everyone points at files or configuration.
  2. List the pages that failWrite down whether the home page, all pages or only uploads return 403. Copy the full address of each failing link.
  3. Think back to the last changeA host move, a new plugin, a firewall setting, an SSL change or a file upload just before the error are the likeliest triggers. Tell your developer or host the date.
  4. Ask the host for the error logHosting support can read the server error log for the failing address. That log line usually names the exact reason in one sentence.
  5. Do not loosen permissions to the maximumSetting every file to be writable by anyone can hide the error while opening the site to attack. Leave permission changes to someone who checks each one.

When should I bring someone in?

  • The whole site is down for customers and the host's answer did not fix it.
  • Only some countries, offices or networks are blocked and you cannot see which rule does it.
  • You run your own server with nginx or Apache and nobody on staff manages it.

How do I handle it?

  1. Reproduce from several networksI request the failing pages from different locations and read the response headers to see whether the 403 comes from the server, a firewall or a CDN in front.
  2. Read the logsThe server's error log and access log for that request show which rule or file caused the refusal.
  3. Fix the narrow causeI correct the single rule, index setting or file permission at fault, and leave every other protection in place.
  4. Recheck the whole siteHome, inner pages, forms, uploads and admin are checked from outside after the fix, and the change is written down for your records.

The price depends on what I find, so I quote in writing after a short discovery call. Tell me what is happening and I reply within 24 hours.

What do owners ask about this?

What does 403 Forbidden mean on my website?

The server received the request and refused to serve it. MDN notes that logging in again makes no difference with a 403, unlike a 401 error.

Why do only some visitors get 403 Forbidden on my site?

An access rule is probably matching them, for example by IP address, country or browser. Firewalls and security plugins create such rules.

Can a 403 error hurt my site in Google?

Pages that answer 403 cannot be read by visitors or crawlers. Fixing it quickly limits the time those pages are unreachable.

Why do my images return 403 but pages load?

The image folder often has different permissions or rules from the pages, especially after uploads or a server move.

Sources

For your developer: the technical fixes

Related help

Free tool for this

Next step

Want this off your desk?

Send me a few lines on where things stand. I reply within 24 hours.