Answer the question
In order to leave comments, you need to log in
How to configure Vagrant to work with routing?
If I understand correctly, in general, Homestead solves my issue in the case of full-fledged frameworks. However, now I'm analyzing the simplest "course" example:
function router($uri)
{
switch ($uri) {
case '/about':
return '<h1>This about</h1>';
break;
default:
return '<h1>This not about</h1>';
break;
}
}
$uri = $_SERVER['REQUEST_URI'];
echo router($uri);
Answer the question
In order to leave comments, you need to log in
There are purely problems with the web server, you need to look at the nginx settings
. By default, Homestead includes all requests for index.php except for folders and files.
Here is the default nginx setting in Homestead:
https://github.com/laravel/homestead/blob/master /s...
location / {
try_files $uri $uri/ /index.php?$args;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question