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

Valdenir's avatar

Hosting a Laravel API service on CentOS server and receiving 404 error

Hello! im hosting a API service on host server CentOS 7 with apache + php 72 + mariaDB, but none of my api routes work

routes/api.php:

Route::get('usuarios/{id?}', 'Users@index' );

postman: http://htweb.hardtec.srv.br/projeto/api/usuarios return 404

if i test on web.php works fine! http://htweb.hardtec.srv.br/projeto/

0 likes
3 replies
Snapey's avatar

obviously you are going to need to put some debuc code in there to see of you are even hitting the routes

Valdenir's avatar

Good morning! today, i changed some things on htaccess and now is working.

Thanks

Please or to participate in this conversation.