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

Atef95's avatar

Public URL laravel

I've been deploying a laravel application on my server it runs with apache web server

I was accessing urls simply with /appname/public

The client wanted me to migrate all the work to his server which also has the same configurations as mine...

I installed everything there properly but ended up with 404 errors when I access to any route except home..

after hours of checking I just added /index.php at the end of URL and it worked..

I would like to know what's causing that ??

0 likes
5 replies
ftiersch's avatar
  1. You should point the root directory of your config to the public directory so you get rid of the /public in the URL. It's also a security measure.

  2. Are you sure, that the configs are identical? It sounds like your clients Apache isn't configured to try index.php automatically if it gets a directory to access.

jlrdw's avatar

Have you done the correct modifications in the apache httpd.conf file.

Snapey's avatar

please don't deploy to your clients server in this way. It will surely get hacked since the .env file will be exposed.

Your issue is probably because you did not copy .htaccess to the server

Please or to participate in this conversation.