zangetsKid zangetsKid - 1 year ago 173
PHP Question

Slim 3 framework group routing

I want to use group routing in Slim 3 Framework, but I always get "Object not found! The requested URL was not found on this server". I am not sure what I did wrong. Here's the code I wrote:


require "vendor/autoload.php";

$app = new \Slim\App();

// API Version Group
$app->group("/v1", function() use($app) {
$app->get("/test1", function() use($app){
return "from v1 tes1";

//Run the app


I ran this locally like :
. Can anyone help me?


Answer Source

I fixed this issue just by adding .htaccess in the root folder.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

Thanks for everyone who helped me!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download