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

JabedHossain's avatar

Issue with Laravel project hosted on AWS - /public in URL and Route errors

I’ve hosted my Laravel project on AWS. The project runs successfully, but the URL includes /public after the directory name. For example: http:////public.

The project is built entirely with Laravel, using Filament for the backend admin panel and Livewire for the frontend pages. I also needed to run the npm run build command due to Livewire requirements.

However, after navigating to /public, all other routes are returning a "Route Not Found" error. Additionally, I want to remove /public from the URL entirely so the project runs directly from the base directory without explicitly mentioning /public.

Could anyone guide me on how to fix this issue? Any help is greatly appreciated!

0 likes
1 reply
Tray2's avatar

You need to set your document_root to the public directory, and make sure to change all your credentials, because it's likely that your .env files is exposed.

Please or to participate in this conversation.