Skip to content

Commit d651069

Browse files
committed
Fix dots routing
1 parent 572533b commit d651069

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

public/index.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,15 @@
1313
use Yiisoft\Yii\Web\SapiEmitter;
1414
use Yiisoft\Yii\Web\ServerRequestFactory;
1515

16-
// PHP built-in server should serve static files as is
17-
if ((PHP_SAPI === 'cli-server') && is_file(__DIR__ . $_SERVER["REQUEST_URI"])) {
18-
return false;
16+
// PHP built-in server routing.
17+
if (PHP_SAPI === 'cli-server') {
18+
// Serve static files as is.
19+
if (is_file(__DIR__ . $_SERVER["REQUEST_URI"])) {
20+
return false;
21+
}
22+
23+
// Explicitly set for URLs with dot.
24+
$_SERVER['SCRIPT_NAME'] = '/index.php';
1925
}
2026

2127
$c3 = dirname(__DIR__) . '/c3.php';

0 commit comments

Comments
 (0)