If you setup laravel pointing to public as document root all should work.
Note this line:
root /srv/example.com/public;
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello! I have an issue on which i could really use some help. I have this laravel project that i have to deploy, i've searched a lot for answers, what i came to was create a folder structure like this: (sorry if i'm messing up with folder tree visuals)
-main folder
-laravel
-public_html
-cs
-index.php
Inside the index.php there are direction like /../../laravel/vendor/autoload.php', which actually brings to my login page. Issue 1: every link is broken (i use Inertia, if that can helps), pointing to a 404 error. Issue 2: My url link somehow is "doubled" like this -> domain/cs/index.php/cs/index.php/login
So, if i type domain/cs it redirects to domain/cs/login (as it is supposed to do, since there is an auth middleware), but the page is a 404. If i type domain/cs/index.php, it redirects to /cs/index.php/login and IMMEDIATLY to domain/cs/index.php/cs/index.php/login showing the login page. Lastly, if I manually enter domain/cs/index.php/cs/index.php/login as a domain, again a 404 error. It's like 4 days since i've started try, i'm pretty desperate.
Please or to participate in this conversation.