18 lines
344 B
PHP
18 lines
344 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
$path = parse_url($_SERVER['REQUEST_URI'] ?? '/', PHP_URL_PATH) ?: '/';
|
|
$file = __DIR__ . $path;
|
|
|
|
if (preg_match('#/(?:\.env(?:\..*)?)$#', $path)) {
|
|
http_response_code(403);
|
|
echo 'Forbidden';
|
|
return true;
|
|
}
|
|
|
|
if ($path !== '/' && is_file($file)) {
|
|
return false;
|
|
}
|
|
|
|
require __DIR__ . '/index.php';
|