summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-11-16 16:06:10 +0000
committerGreg Roach <fisharebest@webtrees.net>2019-11-16 16:06:10 +0000
commit98116b24f349a13d59c9798d52b3efc6d56bfa47 (patch)
tree11534671a37ca5f32e723ed8d51d17a663d4fdd8 /index.php
parentb972b8c97e1dc2a2c6177a5e17a260f556243431 (diff)
downloadwebtrees-98116b24f349a13d59c9798d52b3efc6d56bfa47.tar.gz
webtrees-98116b24f349a13d59c9798d52b3efc6d56bfa47.tar.bz2
webtrees-98116b24f349a13d59c9798d52b3efc6d56bfa47.zip
Fix: routing fails for URLs with port number. Add support for built-in server with pretty URLs.
Diffstat (limited to 'index.php')
-rw-r--r--index.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/index.php b/index.php
index ef874cf35f..72c07806ea 100644
--- a/index.php
+++ b/index.php
@@ -23,9 +23,20 @@ use Middleland\Dispatcher;
use Nyholm\Psr7Server\ServerRequestCreator;
use function app;
+use function parse_url;
+
+use const PHP_SAPI;
+use const PHP_URL_PATH;
require __DIR__ . '/vendor/autoload.php';
+if (PHP_SAPI === 'cli-server') {
+ $file = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
+ if (file_exists($file)) {
+ return false;
+ }
+}
+
// Create the application.
$application = new Webtrees();
$application->bootstrap();