Voilà mon problème : Je suis passé de phpbb2.0.22 à phpbb3.05 en PreMOD. J'avais déjà installé de MOD réécriture avancé sous phpbb2. J'ai décidé, sous phpbb3 de poursuivre avec la réécriture avancée et j'ai choisi également l'option "racine virtuelle" mais je n'ai pas choisi l'option "dossier virtuel" ...
Avant sous phpbb2, j'obtenais des urls de type :
http://www.eco-citoyen.org/Forum/ --> pour l'index
http://www.eco-citoyen.org/Forum/maternite-vf54.html --> pour un forum (sous-forum en fait)
http://www.eco-citoyen.org/Forum/couche ... t1514.html --> pour un topic
Maintenant, sous phpbb3, j'obtiens les urls suivantes :
http://www.eco-citoyen.org/forum.html --> pour l'index
http://www.eco-citoyen.org/maternite-f54.html --> pour le même sous-forum
http://www.eco-citoyen.org/couche-lavable-t1514.html --> pour le même topic
L'ancien index de phpbb2 est bien redirigé vers le nouvel index /forum.html !
Par contre, je souhaiterais que les anciennes urls des forums et des topics soient redirigées automatiquement vers les nouvelles ... actuellement, elles sont redirigées vers une page d'erreur :/ Mais je ne sais pas comment faire cela ... Il me semble qu'il faudrait modifier le htaccess pour insérer des redirections 301 ... non ?
Pour info, voici mes .htaccess, le premier, c'est l'ancien qui était sous phpbb2 et le deuxième est le nouveau sous phpbb3 :
htaccess phpbb2
- Code: Tout sélectionner
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
#########################################################
# PHPBB SEO REWRITE RULES #
#########################################################
# AUTHOR : DCZ http://www.phpbb-seo.com/
# STARTED : 01/2006
#####################################################
# FORUMS PAGES
########################
# FORUM INDEX (un-comment if used)
RewriteRule ^index\[a-z0-9_-]html$ /index.php [QSA,L]
# FORUM PROTECTION RULE
RewriteRule ^Forum/[a-z0-9_-]+/([^/]+\.html)$ Forum/index.php [R=301,L,NC]
# CATEGORIES
RewriteRule ^Forum/[a-z0-9_-]+-vc([0-9]+)\.html$ Forum/index.php?c=$1 [QSA,L,NC]
# PAGINATED FORUM
RewriteRule ^Forum/[a-z0-9_-]+-vf([0-9]+)-([0-9]+)\.html$ Forum/viewforum.php?f=$1&start=$2 [QSA,L,NC]
# FORUM
RewriteRule ^Forum/[a-z0-9_-]+-vf([0-9]+)\.html$ Forum/viewforum.php?f=$1 [QSA,L,NC]
# PAGINATED TOPIC
RewriteRule ^Forum/[a-z0-9_-]+-vt([0-9]+)-([0-9]+)\.html$ Forum/viewtopic.php?t=$1&start=$2 [QSA,L,NC]
# TOPIC
RewriteRule ^Forum/[a-z0-9_-]+-vt([0-9]+)\.html$ Forum/viewtopic.php?t=$1 [QSA,L,NC]
# POST
RewriteRule ^Forum/post([0-9]+)\.html$ Forum/viewtopic.php?p=$1 [QSA,L,NC]
#PROFILES
RewriteRule ^Forum/membre([0-9]+)\.html$ Forum/profile.php?mode=viewprofile&u=$1 [QSA,L,NC]
# END PHPBB PAGES
#####################################################
#########################################################
# SMARTOR ALBUM REWRITE RULES FAP #
#########################################################
# AUTHOR : dcz http://www.phpbb-seo.com/
# STARTED : 2007/02/22
########################
# ALBUM INDEX
RewriteRule ^Forum/album\.html$ /Forum/album.php [QSA,L,NC]
# ALBUM PAGINATED CAT
RewriteRule ^Forum/[a-z0-9_-]+-ac([0-9]+)-([0-9]+)\.html$ /Forum/album_cat.php?cat_id=$1&start=$2 [QSA,L,NC]
# ALBUM CAT
RewriteRule ^Forum/[a-z0-9_-]+-ac([0-9]+)\.html$ /Forum/album_cat.php?cat_id=$1 [QSA,L,NC]
# ALBUM PAGINATED PIC
RewriteRule ^Forum/[a-z0-9_-]+-sp([0-9]+)-([0-9]+)\.html$ /Forum/album_showpage.php?pic_id=$1&start=$2 [QSA,L,NC]
# ALBUM PIC with full option
RewriteRule ^Forum/[a-z0-9_-]+-sp([0-9]+)-?(full)?\.html$ /Forum/album_showpage.php?pic_id=$1&$2 [QSA,L,NC]
# PERSONAL USER GALLERY PAGINATED
RewriteRule ^Forum/[a-z0-9_-]+-ap([0-9]+)-([0-9]+)-?(list|all)?\.html$ /Forum/album.php?user_id=$1&start=$2&mode=$3 [QSA,L,NC]
# PERSONAL USER GALLERY
RewriteRule ^Forum/[a-z0-9_-]+-ap([0-9]+)-?(list|all)?\.html$ /Forum/album.php?user_id=$1&mode=$2 [QSA,L,NC]
# PERSONAL USER CAT PAGINATED
RewriteRule ^Forum/[a-z0-9_-]+-cp([0-9]+)-([0-9]+)-([0-9]+)\.html$ /Forum/album_cat.php?user_id=$1&cat_id=$2&start=$3 [QSA,L,NC]
# PERSONAL USER CAT
RewriteRule ^Forum/[a-z0-9_-]+-cp([0-9]+)-([0-9]+)\.html$ /Forum/album_cat.php?user_id=$1&cat_id=$2 [QSA,L,NC]
# PERSONAL CAT PAGINATED
RewriteRule ^Forum/galeries-membre-([0-9]+)\.html$ /Forum/album_personal_index.php?start=$1 [QSA,L,NC]
# PERSONAL CAT
RewriteRule ^Forum/galeries-membre\.html$ /Forum/album_personal_index.php [QSA,L,NC]
# ALL PICS PAGINATED
RewriteRule ^Forum/liste-images-([0-9]+)\.html$ /Forum/album_allpics.php?start=$1 [QSA,L,NC]
# ALL PICS
RewriteRule ^Forum/liste-images\.html$ /Forum/album_allpics.php [QSA,L,NC]
# THUMBNAILS
RewriteRule ^Forum/[a-z0-9_-]+-thumb([0-9]+)\.jpg$ /Forum/album_thumbnail.php?pic_id=$1 [QSA,L,NC]
# MED
RewriteRule ^Forum/[a-z0-9_-]+-mid([0-9]+)\.jpg$ /Forum/album_picm.php?pic_id=$1 [QSA,L,NC]
# FULL
RewriteRule ^Forum/[a-z0-9_-]+-pic([0-9]+)\.jpg$ /Forum/album_pic.php?pic_id=$1 [QSA,L,NC]
#########################################################
#####################################################
# ANNUAIRE PAGES
########################
RewriteRule ^Forum/eco-annuaire.html$ /Forum/annuaire.php [L]
RewriteRule ^Forum/[a-z0-9_-]+-lc([0-9]+)-([0-9]+)\.html$ /Forum/annuaire.php?mode=cat&id=$1&start=$2 [QSA,L,NC]
RewriteRule ^Forum/[a-z0-9_-]+-lc([0-9]+)\.html$ /Forum/annuaire.php?mode=cat&id=$1 [QSA,L,NC]
RewriteRule ^Forum/[a-z0-9_-]+-lk([0-9]+)\.html$ /Forum/annuaire_comment.php?id=$1 [QSA,L,NC]
# END ANNUAIRE PAGES
#####################################################
#########################################################
# GYM SITEMAPS AND RSS REWRITE RULES #
#########################################################
# AUTHOR : dcz http://www.phpbb-seo.com/
# STARTED : 2006/02/22
########################
# RSS main
RewriteRule ^rss-?(l|s)?-?(m)?\.(xml(\.gz)?)$ /rss.php?$1&$2 [L]
# RSS forums
RewriteRule ^forums-rss-?(l|s)?-?(m)?\.(xml(\.gz)?)$ /rss.php?forum&c&$1&$2 [L]
# RSS all
RewriteRule ^([a-zA-Z0-9_-]+)-rss([0-9]*)-?(l|s)?-?(m)?\.(xml(\.gz)?)$ /rss.php?$1=$2&$3&$4 [L]
# RSS forum topics
RewriteRule ^.+-rf([0-9]+)-?(l|s)?-?(m)?\.(xml(\.gz)?)$ /rss.php?forum=$1&$2&$3 [L]
# SitemapIndex
RewriteRule ^sitemaps\.(xml(\.gz)?)$ /sitemap.php [L]
# Sitemap modules
RewriteRule ^([a-zA-Z0-9_-]+)-sitemap\.(xml(\.gz)?)$ /sitemap.php?$1 [L]
# Forum Sitemaps
RewriteRule ^.+-gf([0-9]+)\.(xml(\.gz)?)$ /sitemap.php?forum=$1 [L]
# Yahoo! urllist.txt
RewriteRule ^urllist\.(txt(\.gz)?)$ /urllist.php [L]
# SITEMAP SITE XML
RewriteRule ^Forum/([a-zA-Z0-9_-]+)-gx\.(xml(\.gz)?)$ /Forum/sitemap.php?xml=$1&$2&$3 [L]
# SITEMAP SITE TXT
RewriteRule ^Forum/([a-zA-Z0-9_-]+)-gt\.(xml(\.gz)?)$ /Forum/sitemap.php?txt=$1 [L]
#########################################################
# END GYM SITEMAPS AND RSS REWRITE RULES #
#########################################################
#########################################################
# BLOG DOTCLEAR 2 REWRITE RULES #
#########################################################
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule (.*) index.php/$1
#RewriteRule ^index.php$ index.php/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteRule ^$ /index.php/ [L]
#########################################################
# END BLOG DOTCLEAR 2 REWRITE RULES #
#########################################################
htaccess sous PHPBB3
- Code: Tout sélectionner
# Lines That should already be in your .htacess
<Files "config.php">
Order Allow,Deny
Deny from All
</Files>
<Files "common.php">
Order Allow,Deny
Deny from All
</Files>
# You may need to un-comment the following lines
# Options +FollowSymlinks
# To make sure that rewritten dir or file (/|.html) will not load dir.php in case it exist
# Options -MultiViews
# REMEBER YOU ONLY NEED TO STARD MOD REWRITE ONCE
RewriteEngine On
# REWRITE BASE
RewriteBase /
# HERE IS A GOOD PLACE TO FORCE CANONICAL DOMAIN
# RewriteCond %{HTTP_HOST} !^www\.eco-citoyen\.org$ [NC]
# RewriteRule ^(.*)$ http://www.eco-citoyen.org/$1 [QSA,L,R=301]
# DO NOT GO FURTHER IF THE REQUESTED FILE / DIR DOES EXISTS
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
#####################################################
# PHPBB SEO REWRITE RULES ALL MODES
#####################################################
# AUTHOR : dcz http://www.phpbb-seo.com
# STARTED : 01/2006
#################################
# FORUMS PAGES
###############
# FORUM INDEX
RewriteRule ^forum\.html$ /Forum/index.php [QSA,L,NC]
# FORUM ALL MODES
RewriteRule ^(forum|[a-z0-9_-]*-f)([0-9]+)(-([0-9]+))?\.html$ /Forum/viewforum.php?f=$2&start=$4 [QSA,L,NC]
# TOPIC WITH VIRTUAL FOLDER ALL MODES
RewriteRule ^(forum|[a-z0-9_-]*-f)([0-9]+)/(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /Forum/viewtopic.php?f=$2&t=$4&start=$6 [QSA,L,NC]
# GLOBAL ANNOUNCES WITH VIRTUAL FOLDER ALL MODES
RewriteRule ^annonces/(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /Forum/viewtopic.php?t=$2&start=$4 [QSA,L,NC]
# TOPIC WITHOUT FORUM ID & DELIM ALL MODES
RewriteRule ^([a-z0-9_-]*)/?(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /Forum/viewtopic.php?forum_uri=$1&t=$3&start=$5 [QSA,L,NC]
# PHPBB FILES ALL MODES
RewriteRule ^ressources/[a-z0-9_-]+/(thumb/)?([0-9]+)$ /Forum/download/file.php?id=$2&t=$1 [QSA,L,NC]
# PROFILES ALL MODES WITH ID
RewriteRule ^(membre|[a-z0-9_-]*-u)([0-9]+)\.html$ /Forum/memberlist.php?mode=viewprofile&u=$2 [QSA,L,NC]
# USER MESSAGES ALL MODES WITH ID
RewriteRule ^(membre|[a-z0-9_-]*-u)([0-9]+)-(topics|posts)(-([0-9]+))?\.html$ /Forum/search.php?author_id=$2&sr=$3&start=$5 [QSA,L,NC]
# GROUPS ALL MODES
RewriteRule ^(groupe|[a-z0-9_-]*-g)([0-9]+)(-([0-9]+))?\.html$ /Forum/memberlist.php?mode=group&g=$2&start=$4 [QSA,L,NC]
# POST
RewriteRule ^post([0-9]+)\.html$ /Forum/viewtopic.php?p=$1 [QSA,L,NC]
# ACTIVE TOPICS
RewriteRule ^sujets-actifs(-([0-9]+))?\.html$ /Forum/search.php?search_id=active_topics&start=$2&sr=topics [QSA,L,NC]
# UNANSWERED TOPICS
RewriteRule ^sans-reponses(-([0-9]+))?\.html$ /Forum/search.php?search_id=unanswered&start=$2&sr=topics [QSA,L,NC]
# NEW POSTS
RewriteRule ^nouveaux-messages(-([0-9]+))?\.html$ /Forum/search.php?search_id=newposts&start=$2&sr=topics [QSA,L,NC]
# THE TEAM
RewriteRule ^equipe\.html$ /Forum/memberlist.php?mode=leaders [QSA,L,NC]
# HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES
#####################################################
# ANNUAIRE PAGES
########################
#RewriteRule ^Forum/eco-annuaire.html$ /Forum/annuaire.php [L]
#RewriteRule ^Forum/[a-z0-9_-]+-lc([0-9]+)-([0-9]+)\.html$ /Forum/annuaire.php?mode=cat&id=$1&start=$2 [QSA,L,NC]
#RewriteRule ^Forum/[a-z0-9_-]+-lc([0-9]+)\.html$ /Forum/annuaire.php?mode=cat&id=$1 [QSA,L,NC]
#RewriteRule ^Forum/[a-z0-9_-]+-lk([0-9]+)\.html$ /Forum/annuaire_comment.php?id=$1 [QSA,L,NC]
# END ANNUAIRE PAGES
#####################################################
#########################################################
# BLOG DOTCLEAR 2 REWRITE RULES #
#########################################################
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule (.*) index.php/$1
#RewriteRule ^index.php$ index.php/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteRule ^$ /index.php/ [L]
#########################################################
# END BLOG DOTCLEAR 2 REWRITE RULES #
#########################################################
# FORUM WITHOUT ID & DELIM ALL MODES (SAME DELIM)
# THESE FOUR LINES MUST BE LOCATED AT THE END OF YOUR HTACCESS TO WORK PROPERLY
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-z0-9_-]+)(-([0-9]+))\.html$ /Forum/viewforum.php?forum_uri=$1&start=$3 [QSA,L,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-z0-9_-]+)\.html$ /Forum/viewforum.php?forum_uri=$1 [QSA,L,NC]
# END PHPBB PAGES
#####################################################
merci pour votre aide ^^

Français |
Anglais

