Laravel on Shared Hosting
The three config files and seven failures nobody documents
Your host gives you FTP, a control panel, and PHP for a few dollars a month. Every Laravel guide assumes a VPS and root. This kit is the gap between them.
The failure that costs a day: you upload the app, point the rewrite at public/index.php, and every route returns 404. Homepage, /login, everything — no error page, nothing in the logs. The cause is SCRIPT_NAME: Laravel derives its base path from it, and rewriting straight to public/ makes it wrong. The fix is a four-line entry point, and it is here.
What you get:
The three config files that run Laravel from a subdirectory: .htaccess, the root entry point, and a public/.htaccess with the line that returns 500 on most shared hosts removed. They only work as a set.
A one-file server check. Upload, open, read the verdict, delete. It reports the PHP version your host actually runs, which is often not the one you picked.
A guide to seven failures: the 404, the 500, the blank page from a rewrite that duplicates your subdirectory, composer killed by the memory limit, storage:link silently doing nothing, web-server-owned files FTP cannot overwrite, and empty directories FTP never uploads.
Five prompts for Claude Code and Codex.
This is configuration and a map of failures, not Laravel and not hosting. The included check tells you in thirty seconds whether your host qualifies.
Verified on Laravel 12 / PHP 8.3 / MySQL 8.4. By EXBRIDGE, Inc. — Nagoya, Japan.


