$ php -S localhost:8000 router.php
router.php
<?php
$url = $_SERVER['REQUEST_URI'];
if (preg_match('/\.html$/', $url)) {
$path = __DIR__ . $url;
if (is_file($path)) {
require_once($path);
exit;
}
}
return false;
More than 5 years have passed since last update.
$ php -S localhost:8000 router.php
<?php
$url = $_SERVER['REQUEST_URI'];
if (preg_match('/\.html$/', $url)) {
$path = __DIR__ . $url;
if (is_file($path)) {
require_once($path);
exit;
}
}
return false;
Register as a new user and use Qiita more conveniently