Laravel 403 Forbidden on hosting: causes and fixes
· The AYT team · 5 min read

A 403 Forbidden in a Laravel site comes from one of two places. Either the web server refuses the request before it reaches Laravel (the document root is the project instead of public, wrong permissions, a refused symbolic link, a web application firewall), or Laravel itself answers 403 (an authorization rule, an invalid signed link, an admin panel that won't let you in on production). The error page tells you which.
Who answered: the web server or Laravel?
Look at the error page:
- a plain white page with "403 Forbidden" and
nginx(orApache) underneath means the web server refused. Laravel never started; - Laravel's page, with "403" and "Forbidden" or the message "This action is unauthorized.", or a JSON response with the same message, means the app refused.
In the first case, the exact reason is in the site's error log, in your hosting panel. nginx writes why it refused: directory index of ... is forbidden, Permission denied or a symbolic link problem.
Don't confuse 403 with 419. "419 Page Expired" comes from CSRF protection, when a form has no token or the session expired.
Cause 1: the document root is the project, not public
The most common cause on hosting. If you upload the project into public_html and the domain points at public_html, the server looks for an index.php right there. Laravel keeps it in public/index.php, so the server finds no index file and refuses to list the folder. The log shows directory index of "/home/.../public_html/" is forbidden.
The right fix is to point the domain at the project's public folder. Don't move index.php to the project root: Laravel's documentation warns that this exposes sensitive configuration files, .env included. Your options when the panel won't let you change the root are in our article on the Laravel public folder.
Cause 2: file permissions
The web server must be able to read the files in public and enter every folder on the way, from /home/username down to the file. A folder with 700 or a file with 600, usually left by an extracted archive or a misconfigured FTP client, gives a 403 and Permission denied in the log.
The usual values: 755 for folders and 644 for files, on hosting where PHP runs as the account's user. .env can stay at 600 or 640, since it must never be served directly. Change permissions from the File Manager or your FTP client.
Cause 3: images from storage return 403
User uploads live in storage/app/public and are served through the public/storage symbolic link that php artisan storage:link creates. If the images return 403, the link has a problem:
- many hosting nginx servers use
disable_symlinks if_not_owner, which follows a symbolic link only when the link and its target have the same owner. A link created by another user (by a script run as root, for example) is refused; - on Apache, the
FollowSymLinksoption may be switched off for the account; - an FTP upload copied the link as an empty folder or a file.
The fix: delete public/storage and create it again as the account's user. php artisan storage:link --relative makes a relative link, which stays valid if you move the project. The steps without SSH are in our article on storage:link without SSH.
Cause 4: the web application firewall (WAF)
Many hosts run a WAF, usually ModSecurity, which blocks requests that look like attacks: a form that submits HTML or SQL, a field containing ../, some API calls. The sign: a 403 only on certain forms or URLs, always on the same action, while the rest of the site works.
Don't try to work around the rule in code. Send your host the URL, the time and your IP, so they can see in the log which rule fired and whether it's a false positive.
Cause 5: the app's authorization
If the page is Laravel's, the request reached the app and the code refused it:
- an explicit
abort(403)in a controller; - a
Gaterule or aPolicythat returnsfalse, with the message "This action is unauthorized.". Check the policy method for that action and the signed-in user.php artisan route:list -vshows each route's middleware,can:included; - your own middleware that checks roles or subscriptions.
Cause 6: an admin panel in production
Filament lets every user into the panel while the app runs locally. In production, the User model must implement FilamentUser and its canAccessPanel() method; without it, anyone who tries /admin gets a 403. The code example is in our Filament tutorial.
Cause 7: an invalid signed link
Signed links (URL::signedRoute), such as email verification links, return 403 with "Invalid signature." if the URL changed on the way. On hosting, the usual cause is the http versus https mismatch: the site runs on HTTPS behind a proxy (Cloudflare, for example), but Laravel thinks the request came over HTTP. Set APP_URL with https:// and configure trusted proxies with trustProxies in bootstrap/app.php.
On AYT hosting
On AYT, a site set up with the Laravel Toolkit is served from current/public, so the document root is right from the start, with no workarounds. The nginx profile for Laravel denies sensitive files, and you read the site's error log on the panel's Errors page.

Check and change permissions from the File Manager. The servers run a WAF (ModSecurity). On the panel's ModSecurity page, under Recent hits, you see the blocked requests with the domain, the URL and the rule that fired. If a rule blocks a legitimate form, you can set that domain to Detection only, which only logs what it would block, while you look for the cause. All the Laravel tools are described under apps.
