GuppYzine (url-rewriting)

http://www.guppyzine.org/

Catégorie : Rewriting

Quelles sont les règles à mettre dans mon htaccess ?

Options +FollowSymlinks
RewriteEngine on

#Index
RewriteRule ^accueil-([a-z]*).html$­­­­ index.php?lng=$­­­­1 [L]
RewriteRule ^([a-z]*)-accueil.html$­­­­ index.php?lng=$­­­­1 [L]

#Telechargements
RewriteRule ^telechargements-([a-z]*).html$­­­­ download.php?lng=$­­­­1 [L]

#Liens
RewriteRule ^liens-([a-z]*).html$­­­­ links.php?lng=fr [L]

#FAQ
RewriteRule ^questions_frequentes-([a-z]*).html$­­­­ faq.php?lng=$­­­­1 [L]
RewriteRule ^questions_frequentes([0-9]*)-([a-z]*).html$­­­­ faq.php?lng=$­­­­2&pg=$­­­­1 [L]
RewriteRule ^imprimefaq([0-9]*)-([a-z]*).html$­­­­ printfaq.php?lng=$­­­­2&pg=$­­­­1 [L]

#Livre d'or
RewriteRule ^livre_d_or-([a-z]*).html$­­­­ guestbk.php?lng=$­­­­1 [L]

#Statistiques
RewriteRule ^statistiques-([a-z]*).html$­­­­ stats.php?lng=$­­­­1 [L]

#Photos
RewriteRule ^photorama-([a-z]*).html$­­­­ photorama.php?lng=$­­­­1 [L]
RewriteRule ^photos-([a-z]*).html$­­­­ photos.php?lng=$­­­­1 [L]

#Nouvelles
RewriteRule ^nouvelles-([a-z]*).html$­­­­ news.php?lng=$­­­­1 [L]
RewriteRule ^nouvelles-([0-9]+)-([a-z]*).html$­­­­ news.php?lng=$­­­­1&pg=$­­­­2 [L]

#articles
RewriteRule ^article-([0-9]*)-([a-zA-Z0-9|_-]+)-([a-z]*).html$­­­­ articles.php?lng=$­­­­3&pg=$­­­&1 [L]
RewriteRule ^article-([0-9]*)-reaction([0-9]*)-([a-z]*).html$­­­­ articles.php?lng=$­­­­3&pg=$­­­­1&react=$­­­2 [L]

#blog
RewriteRule ^blog-([a-z]*).html$­­­­ blogs.php?lng=$­­­­1 [L]
RewriteRule ^blog-([0-9]+)-([a-z]*).html$­­­­ blog.php?lng=$­­­­2&pg=$­­­­1 [L]
RewriteRule ^blog-([0-9]*)-([a-zA-Z0-9|_-]+)-([a-z]*).html$­­­­ blog.php?lng=$­­­­3&pg=$­­­­1 [L]
RewriteRule ^blogs-([0-9]{6})-([a-z]*).html$­­­­ blogs.php?lng=$­­­­2&sel=mois&date=$­­­­1 [L]
RewriteRule ^blogs-([0-9]{8})-([a-z]*).html$­­­­ blogs.php?lng=$­­­­2&sel=jour&datej=$­­­­1 [L]

#forum
RewriteRule ^topics-([a-z]*).html$­­­­ fortopic.php?lng=$­­­­1 [L]
RewriteRule ^liste_des_forums-([a-z]*).html$­­­­ fortopic.php?lng=$­­­­1 [L]
RewriteRule ^forum-([a-z]*).html$­­­­ forum.php?lng=$­­­­1 [L]
RewriteRule ^forum-n(°|[0-9]+)-([a-zA-Z0-9|_-]+)-([a-z]*).html$­­­­ forum.php?lng=$­­­­2&cat=$­­­­1 [L]
RewriteRule ^forum-([0-9]+)-([a-zA-Z0-9|_-]+)-([a-z]*).html$­­­­ forum.php?lng=$­­­­3&cat=$­­­­1 [L]
RewriteRule ^liste_des_fils-([0-9]+)-([0-9]+)-([a-zA-Z0-9|_-]+)-([a-z]*).html$­­­­ forum.php?lng=$­­­­4&cat=$­­­­1&id=$­­­­2 [L]
RewriteRule ^fil-n(°|[0-9]+)-([0-9]+)-([a-zA-Z0-9|_-]+)-([a-z]*).html$­­­­ thread.php?lng=$­­­­4&pg=$­­­­1&cat=$­­­­2 [L]
RewriteRule ^fil-([0-9]+)-([0-9]+)-([0-9]+)-([a-zA-Z0-9|_-]+)-([a-z]*).html$­­­­ thread.php?lng=$­­­­5&pg=$­­­­1&id=$­­­­2&cat=$­­­­3 [L]