Short answer, yes, its either web.config(ngnix) or .htaccess(apache) that tells server to route everything(expect where actual file exists) to index.php.
Feb 10, 2016
3
Level 5
How Does Laravel Route Everything to Index.php?
I'm digging through the framework's source code, trying to learn about the IoC Container and such. It seems that the app is bootstrapped in public/index.php with code like:
require __DIR__.'/../bootstrap/autoload.php';
$app = require_once __DIR__.'/../bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);
My question is how does the server know to hit index.php with every request? Am I wrong about this? Is it in the web.config? If so, is web.config an nginx file? Does web.config take care of nginx while htaccess routes for apache?
Level 29
2 likes
Please or to participate in this conversation.