My app is on C:\xampp\htdocs\urlrouter\klein\
I installed the klein router using composer.
And, I use this script just for simple basic routing
define('APP_PATH', '/urlrouter/klein/');
require_once 'vendor/autoload.php';
$request = \Klein\Request::createFromGlobals();
$request->server()->set('REQUEST_URI', substr($_SERVER['REQUEST_URI'], strlen(APP_PATH)));
$klein = new \Klein\Klein();
$klein->respond('GET', '/hello', function () {
return 'Hello World!';
});
$klein->dispatch($request);
And I also have this .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /index.php [L]
But, when I go to http://localhost/urlrouter/klein/hello
, it redirects me to the XAMPP homepage or http://localhost/xampp/splash.php
I can't figure out what's wrong with this router. Please help me