feat: single entry point routing — convert to front controller pattern

- Create app/public/index.php as front controller (bootstrap + Dispatcher)
- Rewrite app/router.php for PHP dev server → all non-asset requests to index.php
- Update Dispatcher to render full page layouts (head+header+view+footer)
- Move public view templates into templates/public/ (home, search, tfe, about, repertoire)
- Delete dead direct-access public/*.php files (apropos, search, tfe, licence, repertoire)
- Add clean URL routes to Dispatcher (/search, /tfe, /repertoire, /apropos, /licence, /media)
- Remove .php extensions from all internal links (header, views, templates, URLs)
- Update OG tags in controllers to use clean URLs
- Update nginx posterg.conf → front-controller try_files pattern, block direct .php access
- Update header.php and search-bar.php form actions to clean URLs
- Switch AboutController nav key from 'nav' to 'currentNav' for consistency
This commit is contained in:
Pontoporeia
2026-04-20 12:41:55 +02:00
parent 75f808bee4
commit de2e7a61ee
22 changed files with 515 additions and 695 deletions

View File

@@ -30,7 +30,7 @@ class AboutController {
$pd->setSafeMode(true);
return [
'nav' => 'apropos',
'currentNav' => 'apropos',
'aboutHtml' => $pd->text($rawContent),
'contacts' => $contacts,
'credits' => $credits,

View File

@@ -124,7 +124,7 @@ class SearchController
'type' => 'website',
'title' => 'Recherche Posterg',
'description' => "Résultats de recherche dans le répertoire des TFE de l'erg.",
'url' => 'https://posterg.erg.be/search.php',
'url' => 'https://posterg.erg.be/search',
'site_name' => 'Posterg ERG',
],
'currentNav' => 'repertoire',
@@ -174,7 +174,7 @@ class SearchController
'type' => 'website',
'title' => 'Répertoire Posterg',
'description' => "Parcourez le répertoire des mémoires de fin d'études (TFE) de l'erg École de Recherches Graphiques de Bruxelles.",
'url' => 'https://posterg.erg.be/repertoire.php',
'url' => 'https://posterg.erg.be/repertoire',
'site_name' => 'Posterg ERG',
],
'currentNav' => 'repertoire',

View File

@@ -168,7 +168,7 @@ class TfeController
'type' => 'article',
'title' => $title,
'description' => $metaDescription,
'url' => self::BASE_URL . '/tfe.php?id=' . $thesisId,
'url' => self::BASE_URL . '/tfe?id=' . $thesisId,
'image' => $ogImage,
'image_alt' => $imageAlt,
'site_name' => 'Posterg ERG',
@@ -241,7 +241,7 @@ class TfeController
*/
private function redirectHome(): never
{
header('Location: index.php');
header('Location: /');
exit;
}
}