diff --git a/CHANGELOG.md b/CHANGELOG.md index 9960b0d..83086c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,13 @@ Format : [Keep a Changelog](https://keepachangelog.com/fr/1.0.0/) — versionnag --- +## [1.2.2] - 2026-05-14 + +### Corrigé +- URL introuvable : redirige vers la page de recherche (`/search?q=…`) au lieu du premier résultat (#61) + +--- + ## [1.2.1] - 2026-05-14 ### Corrigé diff --git a/public/index.php b/public/index.php index b5cfadd..1a0bdcf 100644 --- a/public/index.php +++ b/public/index.php @@ -68,7 +68,7 @@ function searchAndRedirect(string $rawPath, ArticleManager $articles): void )); $results = (new SearchEngine())->search($query, $pool); if (!empty($results)) { - header('Location: /post/' . rawurlencode($results[0]['article']['slug'] ?? ''), true, 301); + header('Location: /search?q=' . urlencode($query), true, 302); exit; } } diff --git a/public/version.txt b/public/version.txt index 6085e94..23aa839 100644 --- a/public/version.txt +++ b/public/version.txt @@ -1 +1 @@ -1.2.1 +1.2.2