HEX
Server: Apache
System: Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User: u115237990 (7145895)
PHP: 8.3.32
Disabled: NONE
Upload Files
File: /homepages/35/d993672390/htdocs/dermiteseborrheique/social/router.php
<?php
/**
 * router.php — Router central du module social
 * Toutes les URLs passent par ce fichier via .htaccess
 */
define('DS_APP', true);
require_once dirname(__DIR__) . '/includes/init.php';
require_once DS_INCLUDES . 'social.php';

$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$uri = trim(str_replace('/social', '', $uri), '/');

// Routes
if ($uri === '' || $uri === 'index.php') {
    require __DIR__ . '/index.php';

} elseif (preg_match('#^post/([^/]+)$#', $uri, $m)) {
    $_GET['slug'] = $m[1];
    require __DIR__ . '/post/index.php';

} elseif (preg_match('#^categorie/([^/]+)$#', $uri, $m)) {
    $_GET['slug'] = $m[1];
    require __DIR__ . '/categorie/index.php';

} elseif (preg_match('#^u/([^/]+)$#', $uri, $m)) {
    $_GET['u'] = $m[1];
    require __DIR__ . '/u/index.php';

} elseif ($uri === 'new-post' || $uri === 'new-post.php') {
    require __DIR__ . '/new-post.php';

} elseif ($uri === 'setup-username' || $uri === 'setup-username.php') {
    require __DIR__ . '/setup-username.php';

} elseif ($uri === 'api' || $uri === 'api.php') {
    require __DIR__ . '/api.php';

} elseif ($uri === 'sitemap.xml') {
    require __DIR__ . '/sitemap.xml.php';

} else {
    http_response_code(404);
    include DS_ROOT . '/errors/404.php';
}