I created a router.php file in the public root of my project, this file was made as directed in the PHP documentation for the embedded server. It works like an alteranativa to the .htaccess that is not supported by the embedded server.
<?php
if (preg_match('/\.(?:png|jpg|jpeg|gif|js|css|)$/', $_SERVER["REQUEST_URI"])) {
return false;
} else {
include __DIR__ . '/index.php';
}
When I use the command:
php -S 127.0.0.1:8888 public/router.php
To start my server, it does not load CSS and javascripts with the error:
Not Found
The requested resource /assets/css/bootstrap.min.css was not found on this server.
Has anyone ever had a similar situation?
I'm using php7.1 on Windows but I've already tested with version 5.6 and the same thing happens.