27 lines
596 B
PHP
27 lines
596 B
PHP
<?php
|
|
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
|
|
|
// API an index.php routen
|
|
if (strpos($path, '/api/') === 0) {
|
|
require __DIR__ . '/index.php';
|
|
return true;
|
|
}
|
|
|
|
// Statische Dateien ausliefern
|
|
if ($path !== '/' && file_exists(__DIR__ . $path)) {
|
|
return false;
|
|
}
|
|
|
|
// Root -> public/index.html
|
|
if ($path === '/') {
|
|
$file = __DIR__ . '/public/index.html';
|
|
if (file_exists($file)) {
|
|
header('Content-Type: text/html; charset=UTF-8');
|
|
readfile($file);
|
|
return true;
|
|
}
|
|
}
|
|
|
|
// Fallback an index.php
|
|
require __DIR__ . '/index.php';
|
|
return true; |