• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.3 Redirecting from PhpBB

#1
Hello,

I am about to buy over a forum and we're about to finalize the deal. The forum is currently using phpbb with the default urls (non-SEO friendly).

I would like to know how do I redirect the urls to seo friendly xf urls just before I take over the forum so that I'll be able to make the move asap.

I've read a couple of threads but am still a little confused as to which code to use.
 

Jake Bunce

XenForo moderator
Staff member
#2
There are lots of examples if you search. But redirects are always specific to your site. If you post an example old and new thread URL (the same thread from both phpBB and XF) then I can provide exact instructions for your redirects.
 
#3
There are lots of examples if you search. But redirects are always specific to your site. If you post an example old and new thread URL (the same thread from both phpBB and XF) then I can provide exact instructions for your redirects.
Hello Jake, here are the examples of old and new URLs.

Old: viewtopic.php?f=18&t=389
New: threads/forum-upgrades-login-issues.389/

Is there also a way to redirect the forum URLs itself? For example, from:

Old: viewforum.php?f=18
to
New: forums/announcements.18/
 

Jake Bunce

XenForo moderator
Staff member
#4
Hello Jake, here are the examples of old and new URLs.

Old: viewtopic.php?f=18&t=389
New: threads/forum-upgrades-login-issues.389/

Is there also a way to redirect the forum URLs itself? For example, from:

Old: viewforum.php?f=18
to
New: forums/announcements.18/
Add these rules to the top of the .htaccess file in your web root:

Code:
RewriteEngine On

RewriteCond %{QUERY_STRING} (^|\?)f=([0-9]+)&t=([0-9]+)($|&)
RewriteRule ^viewtopic\.php$ /threads/%3/? [R=301,L]

RewriteCond %{QUERY_STRING} (^|\?)f=([0-9]+)($|&)
RewriteRule ^viewforum\.php$ /forums/%2/? [R=301,L]
 

Jake Bunce

XenForo moderator
Staff member
#6
Hi @Jake Bunce ! How about with these urls?

Old: pinoyexpatforum.com/viewtopic.php?f=36&t=1212
New: pinoyexpatforum.com/index.php?threads/how-to-process-haad-dataflow.1212/

Will it be the same with that code?
Slightly different since you don't use friendly URLs.

Add these rules to the top of the .htaccess file in your web root:

Code:
RewriteEngine On

RewriteCond %{QUERY_STRING} (^|\?)f=([0-9]+)&t=([0-9]+)($|&)
RewriteRule ^viewtopic\.php$ /index.php?threads/%3/ [R=301,L]

RewriteCond %{QUERY_STRING} (^|\?)f=([0-9]+)($|&)
RewriteRule ^viewforum\.php$ /index.php?forums/%2/ [R=301,L]
 

clove28

Active member
#11
Waaahh!!!!! I just realized that I could not see the .htaccess file because it was hidden. I kept changing the htaccess.txt not realizing I wa editing the wrong file. Now it works perfectly! I'm really happy! Thanks a lot!
 

Rob

Well-known member
#12
How could I redirect page 2, 3, x of viewforum and viewtopic assuming the pagination stayed the same?
 

Rob

Well-known member
#14
Thanks Jake, all sorted now.

I'm only redirecting first 10 pages as otherwise I'd have to use a rewritemap.