Redirect MyBB urls to phpBB urls via .htaccess [Solved]

Get help with installation and running phpBB 3.1.x here. Please do not post bug reports, feature requests, or extension related questions here.
Suggested Hosts
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: phpBB 3.1.x is at its End of Life stage and support will NOT be provided after July 1st, 2018.
Locked
User avatar
umarizal
Registered User
Posts: 172
Joined: Mon Mar 17, 2008 2:03 am
Location: São Paulo - SP - Brasil
Name: Leandro dos Santos
Contact:

Redirect MyBB urls to phpBB urls via .htaccess [Solved]

Post by umarizal » Wed Sep 07, 2016 4:11 pm

Dear friends, I migrated from MyBB to phpBB and would redirect via .htaccess the urls in this way:

Example:
Old MyBB: "http://www.terraplenagem.net/forum/show ... hp?tid=146"
to...
New phpBB: "http://www.terraplenagem.net/forum/viewtopic.php?t=146"

And other urls as to show forum, to show post...

Can someone help me?

Thank you ;-)
Last edited by umarizal on Sun Sep 11, 2016 7:18 pm, edited 1 time in total.
EN: Do to others what you would want them to do to you.
ES: Haz a los demás todo lo que quieras que te hagan a ti.
PT: Faça aos outros o que você gostaria que fizessem a você.

User avatar
Mick
Support Team Member
Support Team Member
Posts: 21324
Joined: Fri Aug 29, 2008 9:49 am
Location: Watching cricket - definitely

Re: Redirect MyBB urls to phpBB urls via .htaccess

Post by Mick » Wed Sep 07, 2016 7:38 pm

So, basically, you want to swap showthread for viewtopic?

What instructions did you follow (a link is good) for your conversion?
"The more connected we get the more alone we become" - Kyle Broflovski

User avatar
umarizal
Registered User
Posts: 172
Joined: Mon Mar 17, 2008 2:03 am
Location: São Paulo - SP - Brasil
Name: Leandro dos Santos
Contact:

Re: Redirect MyBB urls to phpBB urls via .htaccess

Post by umarizal » Wed Sep 07, 2016 8:02 pm

Mick wrote:So, basically, you want to swap showthread for viewtopic?

What instructions did you follow (a link is good) for your conversion?
I want to redirect all link like "/forum/showthread.php?tid=X" to "/forum/viewtopic.php?t=X" where X is topic ID.

Thank you ;-)
EN: Do to others what you would want them to do to you.
ES: Haz a los demás todo lo que quieras que te hagan a ti.
PT: Faça aos outros o que você gostaria que fizessem a você.

User avatar
umarizal
Registered User
Posts: 172
Joined: Mon Mar 17, 2008 2:03 am
Location: São Paulo - SP - Brasil
Name: Leandro dos Santos
Contact:

Re: Redirect MyBB urls to phpBB urls via .htaccess

Post by umarizal » Thu Sep 08, 2016 12:35 pm

I made it in root .htaccess:
RewriteEngine on
RewriteRule /forum/showthread.php?tid=(.*) /forum/viewtopic.php?t=$1 [R=301,L]
phpBB show: No route found for "GET /showthread.php"

But don´t work :(
EN: Do to others what you would want them to do to you.
ES: Haz a los demás todo lo que quieras que te hagan a ti.
PT: Faça aos outros o que você gostaria que fizessem a você.

.m.
Registered User
Posts: 438
Joined: Wed Nov 04, 2009 8:39 pm

Re: Redirect MyBB urls to phpBB urls via .htaccess

Post by .m. » Thu Sep 08, 2016 12:44 pm

phpBB uses below Rewrite rule
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ app.php [QSA,L]
you can try adding RewriteCond %{REQUEST_FILENAME} !showthread.php
above RewriteRule ^(.*)$ app.php [QSA,L] and check if your redirection rule works ..
Last edited by .m. on Thu Sep 08, 2016 12:46 pm, edited 1 time in total.

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 50582
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Redirect MyBB urls to phpBB urls via .htaccess

Post by stevemaury » Thu Sep 08, 2016 12:45 pm

What does "migraate" mean? Did you use a convertor?
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

User avatar
umarizal
Registered User
Posts: 172
Joined: Mon Mar 17, 2008 2:03 am
Location: São Paulo - SP - Brasil
Name: Leandro dos Santos
Contact:

Re: Redirect MyBB urls to phpBB urls via .htaccess

Post by umarizal » Thu Sep 08, 2016 12:59 pm

stevemaury wrote:What does "migraate" mean? Did you use a convertor?
Yes :D
.m. wrote:phpBB uses below Rewrite rule
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ app.php [QSA,L]
you can try adding RewriteCond %{REQUEST_FILENAME} !showthread.php
above RewriteRule ^(.*)$ app.php [QSA,L] and check if your redirection rule works ..
Don´t work :(
EN: Do to others what you would want them to do to you.
ES: Haz a los demás todo lo que quieras que te hagan a ti.
PT: Faça aos outros o que você gostaria que fizessem a você.

.m.
Registered User
Posts: 438
Joined: Wed Nov 04, 2009 8:39 pm

Re: Redirect MyBB urls to phpBB urls via .htaccess

Post by .m. » Thu Sep 08, 2016 1:12 pm

No route found for "GET /showthread.php"
after adding suggested rule, did you still get above message ?

User avatar
umarizal
Registered User
Posts: 172
Joined: Mon Mar 17, 2008 2:03 am
Location: São Paulo - SP - Brasil
Name: Leandro dos Santos
Contact:

Re: Redirect MyBB urls to phpBB urls via .htaccess

Post by umarizal » Thu Sep 08, 2016 9:13 pm

.m. wrote:
No route found for "GET /showthread.php"
after adding suggested rule, did you still get above message ?
No, after I received 404 error...
EN: Do to others what you would want them to do to you.
ES: Haz a los demás todo lo que quieras que te hagan a ti.
PT: Faça aos outros o que você gostaria que fizessem a você.

User avatar
umarizal
Registered User
Posts: 172
Joined: Mon Mar 17, 2008 2:03 am
Location: São Paulo - SP - Brasil
Name: Leandro dos Santos
Contact:

Re: Redirect MyBB urls to phpBB urls via .htaccess

Post by umarizal » Sun Sep 11, 2016 7:18 pm

A friend helped me through this tip that solved my problem:

a) Create a file "showthread.php":

Code: Select all

<meta http-equiv="refresh" content="0;URL= http://www.terraplenagem.net/forum/viewtopic.php?t=<?php echo $_GET['tid'];?>">
or

b) .htaccess of phpBB folder:

Code: Select all

RewriteEngine On
RewriteCond %{QUERY_STRING} ^tid=([0-9]+).*$
RewriteRule ^showthread.php$ http://www.terraplenagem.net/forum/viewtopic.php?t=%1 [R=301,L]
Thank all, solved!
EN: Do to others what you would want them to do to you.
ES: Haz a los demás todo lo que quieras que te hagan a ti.
PT: Faça aos outros o que você gostaria que fizessem a você.

Locked

Return to “[3.1.x] Support Forum”