How to fix a 403 Forbidden error on a website you manage

Short answer

A 403 Forbidden response means the server understood the request and refused it. To find the cause, send a GET request for the exact URL, note the time and match it to a decision in the CDN, web server or WordPress logs. Correct the rule or file access that conflicts with the site’s intended policy, then repeat both the public request and a check on a resource that should stay private. For affected search pages, also verify the live URL in Search Console.

Read the guide

Updated:

Share

Summarize with ChatGPT or Perplexity

A locked server cabinet and a padlock inside a browser window

Establish what a visitor should be able to open

Start with the link a customer actually clicked. Keep its scheme, hostname, port, path, query string and trailing slash in your private incident notes. A product photograph linked from an order confirmation, an unpublished product page and a customer invoice may live on the same host and have three different access policies. Before changing anything, name the expected outcome for the visitor who reported the problem. An anonymous shopper should see a published product photograph. An invoice can legitimately refuse access after the customer’s session expires.

In browser DevTools, open Network, keep the log during navigation and repeat the original action. Select the failed row and record its request method, status, resource type and timestamp with the time zone. A page can return 200 while the image, style sheet or data request used to draw it returns 403. A price that disappears after the page loads points to a different investigation from an access-denied document replacing the entire storefront. Hand the operator the failed request, with confidential parameter values removed.

Capture the first response

The following read-only request saves the headers and body separately. Set the variable to a public URL on the site you operate. A GET lets you inspect the response a browser would receive for a normal public document. Some applications handle HEAD differently. Avoid adding login cookies from your personal browser to a shared diagnostic command.

curl --silent --show-error --dump-header response.headers \
  --output response.html --write-out '%{http_code}\n' "$PAGE_URL"

If the first status is a redirect, read its Location header and follow the chain before assigning the failure to the starting page. A product URL can redirect to a regional storefront where an entirely different policy applies. Record each status and destination with the redirect chain checker. The HTTP definition of a refusal is in RFC 9110, section 15.5.4.

Find the layer that made the decision

Use a narrow time window around one fresh request. Check the CDN’s security events first if traffic passes through a managed edge. Next inspect the access and error logs for the relevant virtual host, then the application log if the request reached WordPress. Where available, record the request identifier from the response headers. A branded error screen or a Server header gives you a lead. The event with the matching host, path, time and rule gives you a decision you can explain.

Observation Evidence to collect Next action
One public image fails after deployment Its path and a working sibling in the same uploads directory Compare ownership, file access and the deployed file tree.
A directory URL fails and its index file opens The directory named in the error log and the configured index names Restore the expected index or correct the directory mapping.
The CDN records a block Event ID, matched rule and host Review the rule against the intended audience for this route.
Only an editor’s save action fails Method, application endpoint and current session state Check the editor’s assigned capability and request validity.

An empty origin access log can mean the request ended at the edge. It can also mean you opened the wrong site’s log, queried local time against UTC, or looked at a rotation that predates the test. Request a known public page on the same hostname and verify that it appears in the log you are reading. If neither request appears, establish where that host writes its logs before changing a firewall rule. If the edge returns 502, switch to diagnosing the connection from the gateway to the application before changing any access rules.

Check the document root, index and filesystem permissions

For a static asset, work from the path named in the error log. The URL path alone does not establish a filesystem path. Nginx may use an alias, a release process may switch a symlink, and a container can mount a different directory from the one visible on its host. Compare a working asset and the failing asset under the same route. Inspect the files from the environment where the web server runs. A correct mode on a build machine says little about the copy serving traffic.

namei -l "$ASSET_PATH"
stat -c '%A %a %U:%G %n' "$ASSET_PATH" "$WORKING_ASSET"

On Linux, the worker needs search permission on every directory along the path and read permission on the file it serves. A readable file behind a parent directory the worker cannot traverse still fails. Common shared-hosting layouts use 755 for public directories and 644 for public files. In a deployment where the worker belongs to a dedicated group, 750 and 640 can be sufficient. Check the effective worker identity, inherited group membership and any access control list before choosing a change. Leave configuration files with database credentials under their existing restricted policy.

When one file arrived with an incorrect mode, correct that file according to the site’s deployment convention. On a host whose documented public asset mode is 644, the scoped command is chmod 644 "$ASSET_PATH". Then fix the packaging or extraction step that created the inconsistency. A recursive permission change across the site also reaches uploads, credentials and directories managed by other services. It makes the next deployment harder to diagnose and can grant access well beyond the failed image. During a WordPress hosting migration, repeat the file check on the destination before changing DNS.

Interpret a directory index refusal

If Nginx reports that the directory index is forbidden, check the active server block and its index directive. Look for the intended index file in the directory the server resolved. A new release might have copied the project folder one level too deep or omitted its build output. Restore the intended entry point. Turning on a directory listing would expose filenames and give visitors a listing in place of the page. Before reloading an edited configuration, run nginx -t against the active installation. See the Nginx index module documentation.

Separate WordPress access checks from Apache rules

A public WordPress article, the administration area and a save request can generate different responses even while sharing the same front controller. Compare a published page with a known working image. If both fail, inspect the web server and upstream decisions first. If public reading works but editing fails, reproduce the action using an account assigned the relevant role. Note whether the rejection happens on the initial page load, during an upload or only after an editor has kept a tab open for several hours. If the response contains a blank document instead of an access-denied page, use the WordPress white screen guide to check whether PHP stopped while building the page.

For a stale editing session, save unsent text locally, sign in through the normal site flow and open the editor again before retrying. If a newly opened session still fails, check which capability the action requires and whether that capability belongs to this role on this site. In a multisite installation, verify the site as well as the account. Granting administrator rights to get one upload through conceals a role or endpoint error and expands privileges on future requests.

Apache installations can apply access rules in the virtual host, a directory section or an applicable .htaccess file. Review the most recent deployment change and the effective configuration for the affected directory. In particular, distinguish a rule protecting a private backup directory from a misplaced rule inherited by public content. Keep the private directory protected when correcting scope. Nginx does not process .htaccess files. Identify the active server before following instructions for an Apache-specific setting. After an Apache configuration edit, run the installation’s configuration test, commonly apachectl configtest. Consult the Apache access control guide.

Review the WAF decision and its scope

When Cloudflare records a matching security event, capture the action, rule identifier, hostname and requested route. Compare the event with the site’s policy for that route. A rule designed to protect checkout submissions may have been applied to public catalogue pages during a recent ruleset change. Review the condition with the person responsible for checkout security. A correction that restores anonymous access to product documentation should leave the checkout controls operating as intended. Cloudflare describes edge and origin responses in its 403 troubleshooting guide.

Decision owner Working evidence Acceptance test
Hosting team The worker cannot traverse a release directory The exported image opens; private configuration stays inaccessible.
WordPress administrator A role lost the capability required by the editorial workflow The designated editor completes the action; a subscriber cannot.
Edge security team A managed rule matches an ordinary public page request The page loads under its intended policy; protected routes retain their controls.

Pros and cons

For a WordPress site behind a reverse proxy, also check that the public request reaches the intended hostname and route. Keep a redirect problem separate from a permissions problem. One can lead to the other when a canonical redirect sends visitors to a protected host. The WordPress reverse proxy redirect guide explains how to trace the handoff when the first response changes the visitor’s destination.

Verify recovery for visitors and search engines

Repeat the original request both in the browser and with the saved command. Inspect the final status, content type and a distinctive part of the expected body. A response can switch from 403 to 200 while still delivering a login screen or a generic error page. For an image, check that the browser decodes it and reports the expected dimensions. For an article, check its heading and canonical URL. Repeat the protected control case and document the result alongside the public success.

Search engines cannot index content they cannot retrieve. Google’s documentation explains how persistent HTTP errors affect crawling and indexing. Once an important public page recovers, inspect the live URL in Search Console and distinguish its current response from the last recorded crawl. Retain the time of the fix. A report based on yesterday’s crawl can legitimately describe a failure even after today’s live test succeeds.

If someone suspects a crawler-only refusal, check actual requests in your access logs and the corresponding security events. A User-Agent string can be set by any client; use the search provider’s verification procedure before attributing requests to its crawler. The bot log checker can help group observed responses. Review crawl instructions separately in the robots.txt checker. Publishing an Allow line will not grant access that the web server refuses.

For the release record, list the failed public URL, the layer that rejected it, the change owner and the checks that now pass. Use the webmaster tools catalogue to repeat the related checks after the next deployment. For a broader review of the surrounding templates, use the technical SEO audit guide or the overview of technical SEO in Russian.

Frequently asked questions

Will clearing the browser cache fix a 403?

It may change what a visitor sees if a cached response is involved. Check a fresh request and compare timestamps with the server logs. Purging a cached error has lasting value once the underlying access decision is correct.

Why does a page open for an administrator but fail for a customer?

The accounts may have different capabilities, or the administrator may be previewing unpublished content. Confirm the publication state and expected customer permissions before editing the role or the server configuration.

Should I restore a previous .htaccess file?

Compare the current file with the version from the last known working release. Restore only the change responsible for the refusal after reviewing its purpose, especially when the same file protects private paths.

Does an IP address in the access log identify the visitor?

Behind a proxy, the logged address may belong to the proxy itself. Check which field your trusted proxy configuration records for the original connection and pair it with the request identifier and timestamp.

When can I close the incident?

Close it once the affected public action works, the protected control still rejects unauthorized access, and new logs show the intended result. If search traffic was affected, assign a follow-up for the next recorded crawl without delaying closure of the operational fix.

← Back to blog

Need help with your website?

Development and SEO services →

Related articles