From 7e5280abcda1cec6c9591e99ff3335110a298ac6 Mon Sep 17 00:00:00 2001 From: Cedric Abonnel Date: Tue, 12 May 2026 10:07:26 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20clean=20URLs=20pour=20cat=C3=A9gories?= =?UTF-8?q?=20et=20pagination?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/.htaccess | 6 ++++++ templates/layout.php | 2 +- templates/post_list.php | 18 ++++++++++++++---- templates/post_view.php | 2 +- templates/search.php | 2 +- 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/public/.htaccess b/public/.htaccess index 26faccf..0b95597 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -11,6 +11,12 @@ RewriteRule ^ - [L] # URL propre pour les articles : /post/ RewriteRule ^post/([a-z0-9][a-z0-9-]*)/?$ /index.php?action=view&slug=$1 [L,QSA] +# Filtre par catégorie : /categorie/ +RewriteRule ^categorie/(.+?)/?$ /index.php?cat=$1 [L,QSA,NE] + +# Pagination par curseur : /cursor/ +RewriteRule ^cursor/([0-9a-f-]{36})/?$ /index.php?cursor=$1 [L,QSA] + # Édition / création RewriteRule ^edit/([0-9a-f-]{36})/?$ /index.php?action=edit&uuid=$1 [L,QSA] RewriteRule ^new/?$ /index.php?action=create [L,QSA] diff --git a/templates/layout.php b/templates/layout.php index 365b87f..5ca6ca5 100644 --- a/templates/layout.php +++ b/templates/layout.php @@ -76,7 +76,7 @@ $isPriv = in_array($catName, $_layoutPrivateCats, true); ?>