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

vincent15000's avatar

Routing seems not to work in production / Error 404

Hello,

I publish today a personal project to help me to manage my shopping-list.

On my local computer, no problem.

But on the web hosting server, I can access to the root of the website (no problem), but the other routes seem not to be recognized by the app.

I have done this action several times and I had never any problem with other projects.

I have cached the config, the routes, the views, I have generated a livewire:discover, ... but nothing happens. I have checked the PHP version which was positioned on 8.0 by the web hosting, I have changed it to 7.4.

The routes exist and the view file too.

No more idea for me.

What could be the problem ?

Thanks for your help.

Vincent

0 likes
2 replies
vincent15000's avatar

The .htaccess file was not automatically sent to the server via git. Strange because the other times it was transfered automatically. The file is not in my .gitignore.

Now I have an Internal Server Error 500. And that's the case for every route. For example when I try to access to the member/dashboard route in local, it redirects me automatically to the login page if not connected. But it's not the case in production where no redirection is done (only error 500 instead).

vincent15000's avatar
vincent15000
OP
Best Answer
Level 63

It's ok, problem solved. I've had to add RewriteBase / at the beginning of my .htaccess file.

Please or to participate in this conversation.