61 lines
2.3 KiB
ApacheConf
61 lines
2.3 KiB
ApacheConf
Options -Indexes
|
|
DirectoryIndex index.php
|
|
|
|
RewriteEngine On
|
|
|
|
# Fichiers et répertoires réels servis directement
|
|
RewriteCond %{REQUEST_FILENAME} -f [OR]
|
|
RewriteCond %{REQUEST_FILENAME} -d
|
|
RewriteRule ^ - [L]
|
|
|
|
# URL propre pour les articles : /post/<slug>
|
|
RewriteRule ^post/([a-z0-9][a-z0-9-]*)/?$ /index.php?action=view&slug=$1 [L,QSA]
|
|
|
|
# Filtre par catégorie : /categorie/<nom>
|
|
RewriteRule ^categorie/(.+?)/?$ /index.php?cat=$1 [L,QSA,NE]
|
|
|
|
# Pagination par curseur : /page/<uuid>
|
|
RewriteRule ^page/([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]
|
|
RewriteRule ^delete/([0-9a-f-]{36})/?$ /index.php?action=delete&uuid=$1 [L,QSA]
|
|
|
|
# Sources et diff
|
|
RewriteRule ^sources/([0-9a-f-]{36})/?$ /index.php?action=sources&uuid=$1 [L,QSA]
|
|
RewriteRule ^diff/([0-9a-f-]{36})/(\d+)/?$ /index.php?action=diff&uuid=$1&rev=$2 [L,QSA]
|
|
|
|
# Fichiers / import
|
|
RewriteRule ^files/([0-9a-f-]{36})/add/?$ /index.php?action=add_files&uuid=$1 [L,QSA]
|
|
RewriteRule ^import/([0-9a-f-]{36})/?$ /index.php?action=import_image&uuid=$1 [L,QSA]
|
|
|
|
# Admin (regen-thumbs avant la règle générique admin/<tab>)
|
|
RewriteRule ^admin/regen-thumbs/?$ /index.php?action=regen_thumbs [L,QSA]
|
|
RewriteRule ^admin/([a-z0-9-]+)/?$ /index.php?action=admin&tab=$1 [L,QSA]
|
|
RewriteRule ^admin/?$ /index.php?action=admin [L,QSA]
|
|
|
|
# Pages de gestion
|
|
RewriteRule ^categories/?$ /index.php?action=categories [L,QSA]
|
|
RewriteRule ^profile/?$ /index.php?action=profile [L,QSA]
|
|
RewriteRule ^search/?$ /index.php?action=search [L,QSA]
|
|
|
|
# Pages statiques
|
|
RewriteRule ^about/?$ /index.php?action=about [L,QSA]
|
|
RewriteRule ^legal/?$ /index.php?action=legal [L,QSA]
|
|
RewriteRule ^licenses/?$ /index.php?action=licenses [L,QSA]
|
|
RewriteRule ^contact/?$ /index.php?action=contact [L,QSA]
|
|
|
|
# Flux RSS — /feed est canonique, /rss et /rss.xml redirigent en 301
|
|
RewriteRule ^rss/?$ /feed [R=301,L]
|
|
RewriteRule ^rss\.xml$ /feed [R=301,L]
|
|
RewriteRule ^feed/([0-9a-f-]{36})/?$ /feed.php?after=$1 [L,QSA]
|
|
RewriteRule ^feed/?$ /feed.php [L,QSA]
|
|
|
|
# Sitemap
|
|
RewriteRule ^sitemap\.xml$ /sitemap.php [L]
|
|
|
|
# Ajoute .php si le fichier correspondant existe
|
|
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI}.php -f
|
|
RewriteRule ^(.+?)/?$ /$1.php [L,QSA]
|