Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mb.ouazzani's avatar

Laravel 8 at sub-directory - 404 error issue

Hi,

We're using Laravel 8, it's deployed on a sub-directory on our main domain : http://www.domain.com/app

We were able to get the default home page routed by "/" which redirect to public/welcome...

We used a template Craftable to generate an admin interface and had the CRUD Generator It works fine locally (http://127.0.0.1/admin) but we got 404 error on the online version (http://www.domain.com/app/admin)

We suspect this difference of path to be the cause of our 404 error, since we're using sub-directory on the online version, any solution for this problem?

Thanks

0 likes
2 replies
mb.ouazzani's avatar

Thanks rohit_mg,

I followed the instructions on the link you sent regarding deploying laravel on subfolder, and it works much better for me, with taking care of security recommendations as a bonus.

I made the app folder outside the www folder and the public folder only inside. I created a public link inside app folder which is pointing to the real public folder inside www After deployment of Craftable I was able to access to login page, which was impossible before

Still have an issue to fix : the resources (css, js...) link are still based on / instead of subfolder path

Regarding your question, we're on a shared hosting plan

Please or to participate in this conversation.