Slim Api working fine with localhost but giving error on shared hosting

Details

Type: Slim\Exception\HttpNotFoundException

Code: 404

Message: Not found.

File: /home/sites/9a/9/902af2e37b/public_html/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php

Line: 91

Trace

#0 /home/sites/9a/9/902af2e37b/public_html/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php(57): Slim\Middleware\RoutingMiddleware->performRouting(Object(Slim\Psr7\Request)) #1 /home/sites/9a/9/902af2e37b/public_html/vendor/slim/slim/Slim/MiddlewareDispatcher.php(132): Slim\Middleware\RoutingMiddleware->process(Object(Slim\Psr7\Request), Object(Slim\Routing\RouteRunner)) #2 /home/sites/9a/9/902af2e37b/public_html/vendor/slim/slim/Slim/Middleware/ErrorMiddleware.php(89): class@anonymous->handle(Object(Slim\Psr7\Request)) #3 /home/sites/9a/9/902af2e37b/public_html/vendor/slim/slim/Slim/MiddlewareDispatcher.php(132): Slim\Middleware\ErrorMiddleware->process(Object(Slim\Psr7\Request), Object(class@anonymous)) #4 /home/sites/9a/9/902af2e37b/public_html/vendor/slim/slim/Slim/MiddlewareDispatcher.php(73): class@anonymous->handle(Object(Slim\Psr7\Request)) #5 /home/sites/9a/9/902af2e37b/public_html/vendor/slim/slim/Slim/App.php(206): Slim\MiddlewareDispatcher->handle(Object(Slim\Psr7\Request)) #6 /home/sites/9a/9/902af2e37b/public_html/vendor/slim/slim/Slim/App.php(190): Slim\App->handle(Object(Slim\Psr7\Request)) #7 /home/sites/9a/9/902af2e37b/public_html/public/index.php(125): Slim\App->run() #8 {main}

Can you show how you access the same resource on your localhost? The Url, I mean.

And what is your localhost server and your shared host server? (Php embeded, Apache, other)

Hello had you found any solution for that?

This question has been discussed here many times :slight_smile:

Here are some solutions: