Moving from phpBB2 to phpBB3

phpBB2 SEO Advanced mod Rewrite support forum.
This mods performs URL rewriting for phpBB, injecting categories, forums and topic titles in their URLs.

Moderator: Moderators

Moving from phpBB2 to phpBB3

Postby GrayGhost » Tue Feb 17, 2009 4:41 am

Hello! I was hoping I could get a little assistance with rewrite and redirecting my old links in google to the new ones. I was using advanced rewrite for my old forum and and advanced rewrite for my new one as well.

As far as what I can tell, the really thing I need assistance is redirecting the old links to the new ones. Since I have kept the format relatively the same, the only difference really between the new and the old links is the "v". I don't currently use the virtual folders.

For example, an old link would be /discussion/example-topic-vt123.html, and the new one would be /discussion/example-topic-t123.html.

The same thing applies for example-forum-vf4.html is now example-forum-f4.html.


Here is my old .htaccess:

Code: Select all
#########################################################
# PHPBB SEO REWRITE RULES            #
#########################################################
# AUTHOR : DCZ http://www.phpbb-seo.com/
# STARTED : 01/2006
#####################################################
# FORUMS PAGES
########################
# FORUM PROTECTION RULE
RewriteRule ^discussion/.+/([^/]+\.html)$ /discussion/index.php [R=301,L]
# CATEGORIES
RewriteRule ^discussion/.+-vc([0-9]+)\.html$ /discussion/index.php?c=$1 [QSA,L]
# PAGINATED FORUM
RewriteRule ^discussion/.+-vf([0-9]+)-([0-9]+)\.html$ /discussion/viewforum.php?f=$1&start=$2 [QSA,L]
# FORUM
RewriteRule ^discussion/.+-vf([0-9]+)\.html$ /discussion/viewforum.php?f=$1 [QSA,L]
# PAGINATED TOPIC
RewriteRule ^discussion/.+-vt([0-9]+)-([0-9]+)\.html$ /discussion/viewtopic.php?t=$1&start=$2 [QSA,L]
# TOPIC
RewriteRule ^discussion/.+-vt([0-9]+)\.html$ /discussion/viewtopic.php?t=$1 [QSA,L]
# POST
RewriteRule ^discussion/post([0-9]+)\.html$ /discussion/viewtopic.php?p=$1 [QSA,L]
#PROFILES
RewriteRule ^discussion/member([0-9]+)\.html$ /discussion/profile.php?mode=viewprofile&u=$1 [QSA,L]
# END phpbb PAGES
#####################################################



And here is my new one:

Code: Select all
#####################################################
# PHPBB SEO REWRITE RULES - ADVANCED
#####################################################
# AUTHOR : dcz www.phpbb-seo.com
# STARTED : 01/2006
#################################
# FORUMS PAGES
###############
# FORUM INDEX REWRITERULE WOULD STAND HERE IF USED. "forum" REQUIRES TO BE SET AS FORUM INDEX
# RewriteRule ^discussion/forum\.html$ /discussion/index.php [QSA,L,NC]
# FORUM
RewriteRule ^discussion/[a-z0-9_-]*-f([0-9]+)(-([0-9]+))?\.html$ /discussion/viewforum.php?f=$1&start=$3 [QSA,L,NC]
# TOPIC WITH VIRTUAL FOLDER
RewriteRule ^discussion/[a-z0-9_-]*-f([0-9]+)/[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html$ /discussion/viewtopic.php?f=$1&t=$2&start=$4 [QSA,L,NC]
# GLOBAL ANNOUNCES WITH VIRTUAL FOLDER
RewriteRule ^discussion/announces/[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html$ /discussion/viewtopic.php?t=$1&start=$3 [QSA,L,NC]
# TOPIC WITHOUT FORUM ID & DELIM
RewriteRule ^discussion/([a-z0-9_-]*)/?[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html$ /discussion/viewtopic.php?forum_uri=$1&t=$2&start=$4 [QSA,L,NC]
# PROFILES SIMPLE
RewriteRule ^discussion/member([0-9]+)\.html$ /discussion/memberlist.php?mode=viewprofile&u=$1 [QSA,L,NC]
# USER MESSAGES SIMPLE
RewriteRule ^discussion/member([0-9]+)-(topics|posts)(-([0-9]+))?\.html$ /discussion/search.php?author_id=$1&sr=$2&start=$4 [QSA,L,NC]
# GROUPS SIMPLE
RewriteRule ^discussion/group([0-9]+)(-([0-9]+))?\.html$ /discussion/memberlist.php?mode=group&g=$1&start=$3 [QSA,L,NC]
# POST
RewriteRule ^discussion/post([0-9]+)\.html$ /discussion/viewtopic.php?p=$1 [QSA,L,NC]
# ACTIVE TOPICS
RewriteRule ^discussion/active-topics(-([0-9]+))?\.html$ /discussion/search.php?search_id=active_topics&start=$2&sr=topics [QSA,L,NC]
# UNANSWERED TOPICS
RewriteRule ^discussion/unanswered(-([0-9]+))?\.html$ /discussion/search.php?search_id=unanswered&start=$2&sr=topics [QSA,L,NC]
# NEW POSTS
RewriteRule ^discussion/newposts(-([0-9]+))?\.html$ /discussion/search.php?search_id=newposts&start=$2&sr=topics [QSA,L,NC]
# THE TEAM
RewriteRule ^discussion/the-team\.html$ /discussion/memberlist.php?mode=leaders [QSA,L,NC]
# HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES



Thanks!
GrayGhost
 
Posts: 19
Joined: Thu Oct 12, 2006 9:49 pm

Advertisement

Postby dcz » Tue Feb 17, 2009 10:24 am

You can deal with this two different ways.

If you really want to keep the same urls as before, then you should keep the -vt's in phpBB3, by replacing :
Code: Select all
      $this->seo_delim = array( 'forum' => '-f', 'topic' => '-t', 'user' => '-u', 'group' => '-g', 'start' => '-', 'sr' => '-', 'file' => '/');

with :
Code: Select all
      $this->seo_delim = array( 'forum' => '-vf', 'topic' => '-vt', 'user' => '-u', 'group' => '-g', 'start' => '-', 'sr' => '-', 'file' => '/');


in phpbb_seo_class.php.
That would lower the amount of redirecting.
Since you do not really need to redirect all urls for just the "v" in -vt's. You'd just need to generate a new .htaccess once done.
And keep :
Code: Select all
# PHPBB2 CATEGORIES
RewriteRule ^discussion/[a-z0-9_-]*-vc([0-9]+)\.html$ /discussion/index.php [QSA,L,NC]
# PHPBB2 PROFILES
RewriteRule ^discussion/member([0-9]+)\.html$ /discussion/memberlist.php?mode=viewprofile&u=$1 [QSA,L,NC]

after :
Code: Select all
# HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES

in your phpBB3's .htaccess.

Or, you can decide to go for more different urls, it's really up to you. In such case, you cold go for the new delimiters (-t) and would just need to keep few more rewriterules after the two mentionned above, eg :
Code: Select all
# PHPBB2 FORUM
RewriteRule ^discussion/[a-z0-9_-]*-vf([0-9]+)(-([0-9]+))?\.html$ /discussion/viewforum.php?f=$1&start=$3 [QSA,L,NC]
# PHPBB2 TOPIC
RewriteRule ^discussion/[a-z0-9_-]*-vt([0-9]+)(-([0-9]+))?\.html$ /discussion/viewtopic.php?t=$1&start=$3 [QSA,L,NC] 


++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21219
Joined: Fri Apr 28, 2006 9:03 pm


Return to phpBB2 Advanced mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 3 guests