Skip to content

4xx Client errors

403 Forbidden

The server understood who you are but refuses the request. On shared hosting this often comes from file permissions or a security rule, not from your app.

Common causes

  • File or folder permissions too strict (or too open: some hosts refuse 777).
  • A ModSecurity / LiteSpeed WAF rule blocking the request body (for example code or HTML in a form).
  • The app's own authorization (a policy or gate said no).
  • No index file and directory listing disabled.

How to fix a 403 error

  1. 1

    Set folders to 755 and files to 644.

  2. 2

    Check the cPanel error log: a WAF block names the rule id. Ask the host to whitelist it, or encode the field before sending.

  3. 3

    In Laravel, check the policy or Gate that throws AuthorizationException.

  4. 4

    Make sure the domain points to Laravel's public/ folder.

In Laravel

abort(403) and failed policies (AuthorizationException) send 403. A 403 with a plain server page (not your app's) means the web server blocked it before Laravel ran.

Check the status of a URL

The first line of the response shows the status code; -L follows redirects and shows each step.

curl -I https://example.com/page
curl -IL https://example.com/old-page

Frequently asked questions

What does HTTP 403 mean?

The server understood who you are but refuses the request. On shared hosting this often comes from file permissions or a security rule, not from your app.

How do I fix a 403 error?

Set folders to 755 and files to 644. Check the cPanel error log: a WAF block names the rule id. Ask the host to whitelist it, or encode the field before sending. In Laravel, check the policy or Gate that throws AuthorizationException. Make sure the domain points to Laravel's public/ folder.

How does Laravel handle 403?

abort(403) and failed policies (AuthorizationException) send 403. A 403 with a plain server page (not your app's) means the web server blocked it before Laravel ran.

Get new articles in your inbox

Practical tutorials and deep dives, about once a week. No spam, unsubscribe anytime.

Privacy policy

Add DEV Talk to your Home Screen

  1. 1 Tap the Share button in Safari's toolbar.
  2. 2 Scroll down and tap Add to Home Screen.
  3. 3 Tap Add. Open it from the Home Screen to read like an app and to turn on notifications with the bell.

We use cookies to improve your experience and analyze traffic. By continuing, you agree to our Privacy Policy.