Jump to content

Proper redirects from root.com to forums.root.com w/ NGINX


Recommended Posts

I've migrated from myBB @ (root.com) to IPB @ (forums.root.com). I used the provided converter but I believe the URL redirects only work if the IPB install is in the same location as the myBB install? I cannot seem to get url redirects to work properly using a sub-domain. Can anyone advise on how to set mybb thread links to redirect to IPB threads using the data in convert_link_topics?

Thanks!

Link to comment
Share on other sites

Hi @cdymlr

The best way to do this is to use mod_rewrite in the .htaccess file for your root domain to redirect the specific MyBB requests.

Looking at their existing rules that ship with MyBB, you can simply just change them to have your complete URL in them

i.e.

RewriteRule ^thread-([0-9]+)\.html$ https://forums.root.com/showthread.php?tid=$1 [L,QSA]

However, if you weren't using MyBB friendly URLs, you would need to customize the rules to redirect the PHP controllers instead...

RewriteRule ^showthread.php$ https://forums.root.com/showthread.php [L,QSA]

(you would also need to do this for the other supported URLs such as member.php & forumdisplay.php)

You will likely need to tweak and test these to meet your specific scenario, but that should give you an idea of how to address the issue.

Link to comment
Share on other sites

On 7/8/2020 at 5:43 AM, Stuart Silvester said:

Hi @cdymlr

The best way to do this is to use mod_rewrite in the .htaccess file for your root domain to redirect the specific MyBB requests.

Looking at their existing rules that ship with MyBB, you can simply just change them to have your complete URL in them

i.e.


RewriteRule ^thread-([0-9]+)\.html$ https://forums.root.com/showthread.php?tid=$1 [L,QSA]

However, if you weren't using MyBB friendly URLs, you would need to customize the rules to redirect the PHP controllers instead...


RewriteRule ^showthread.php$ https://forums.root.com/showthread.php [L,QSA]

(you would also need to do this for the other supported URLs such as member.php & forumdisplay.php)

You will likely need to tweak and test these to meet your specific scenario, but that should give you an idea of how to address the issue.

Thank you @Stuart Silvesterfor the very detailed response! We are using Nginx and not Apache but this should lead me in the right direction. I did manage to get the URLs to redirect but the issue I'm running into now is the topic IDs vary from myBB to Invision and although the converter stores this info in the database this conversion from myBB's tid to Invisions pid is not happening. Thanks again!

Link to comment
Share on other sites

Just to be more clear, with the following redirect rule

location /showthread {
  rewrite ^/showthread.php$ https://forums.root.com/showthread.php redirect;
}

https://www.root.com/showthread.php?pid=55269 is being redirected to https://forums.root.com/showthread.php?pid=55269 where the Invision pid is different from the myBB one. The converter has linked the two different IDs together in core_link_topics but I can't quite figure this part out. 

Edited by cdymlr
Link to comment
Share on other sites

12 hours ago, cdymlr said:

Just to be more clear, with the following redirect rule


location /showthread {
  rewrite ^/showthread.php$ https://forums.root.com/showthread.php redirect;
}

https://www.root.com/showthread.php?pid=55269 is being redirected to https://forums.root.com/showthread.php?pid=55269 where the Invision pid is different from the myBB one. The converter has linked the two different IDs together in core_link_topics but I can't quite figure this part out. 

I would recommend submitting a support ticket, the converter automatically handles the difference in IDs but I can see in the converter that we're expecting 'tid' for showthread.php, not 'pid'. Submit a support ticket, we can test the addition of that rule for posts.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...