mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-07 03:29:19 +02:00
27 lines
753 B
PHP
27 lines
753 B
PHP
<?php
|
|
/**
|
|
* Router script for PHP built-in development server (php -S).
|
|
*
|
|
* Routes /partage/<slug> to public/partage/index.php, since the built-in
|
|
* server has no URL rewriting like nginx's try_files.
|
|
*/
|
|
|
|
$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
|
|
|
// Route /partage/<slug> and /partage/<slug>/<action> to the partage entry
|
|
if (preg_match('#^/partage(/.*)?$#', $uri)) {
|
|
$_SERVER['SCRIPT_NAME'] = '/partage/index.php';
|
|
require __DIR__ . '/../public/partage/index.php';
|
|
return true;
|
|
}
|
|
|
|
// Route /tfe/<...> to tfe.php
|
|
if (preg_match('#^/tfe(/.*)?$#', $uri)) {
|
|
$_SERVER['SCRIPT_NAME'] = '/tfe.php';
|
|
require __DIR__ . '/../public/tfe.php';
|
|
return true;
|
|
}
|
|
|
|
// Default: serve static files if they exist
|
|
return false;
|