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

XF 1.2 Merged 2 xenforo sites

Discussion in 'Installation, Upgrade, and Import Support' started by AWS, Jan 4, 2014.

  1. AWS

    AWS Well-Known Member

    I recently acquired a forum in the same niche. I decided to merge the 2 rather than having 2 sites covering the same topic.

    Is there a way to set redirect URLs of the merged site so that the links to the threads and posts are not broken?
     
  2. Liam W

    Liam W Well-Known Member

    No, there isn't in any way, as the content ID's will be completely different, as there was already content present.

    Liam
     
  3. Alfa1

    Alfa1 Well-Known Member

    This needs an addon
     
  4. Liam W

    Liam W Well-Known Member

    How would it work though? The content ID's would be completely changed up, so there would be no way to map from the old posts to the new ones...

    Liam
     
  5. Alfa1

    Alfa1 Well-Known Member

    The old Ids and an id for the original site would need to be kept in a separate table.
    It's not optimal. But it does allow for redirects.
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    Did you save/archive the import log?
    If so it will be possible but it would require a redirection script.
    I don't believe one has been written for an XF to XF import.
     
    Alfa1 likes this.
  7. AWS

    AWS Well-Known Member

    Yes I did save the import log. I was looking through the resource manager and import docs and didn't see any redirection scripts for a xenforo to xenforo merge.
     
  8. Brogan

    Brogan XenForo Moderator Staff Member

    I don't believe there is one; I don't think there have been many XF to XF imports up to this point so the demand hasn't really been there.

    It wouldn't be too difficult to write one, considering the URL structure is the same.
    Unfortunately I don't have time to do that at the moment.
     
    AWS likes this.
  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I can help with this. I need an example old and new URL of the same thread on both the old and new forum.

    Ideally the two forums were on different domains which will allow us to limit the redirects to just the old forum's URLs.
     
  10. AWS

    AWS Well-Known Member

  11. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Upload these scripts to the web root of admin-talk.com:

    http://xenforo.com/community/resources/redirection-scripts-for-vbulletin-3-x.264/

    If your import records are not contained in the xf_import_log table then you need to edit the 301config.php file to specify the name of the table.

    Then add these rules to the top of the .htaccess file in the web root for adminaddict.net. If both domains are parked on the same site then it will be XF's .htaccess file which is fine:

    Code:
    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^(www\.)?adminaddict\.net$
    RewriteRule ^threads/([0-9]+)/ http://admin-talk.com/showthread.php?t=$1 [R=301,L]
    
    That should do it.
     
    AlexKim, Breixo, BamaStangGuy and 3 others like this.
  12. AWS

    AWS Well-Known Member

    Works perfect. All threads redirect to the correct URLs. Thanks Jake.
     
  13. BamaStangGuy

    BamaStangGuy Well-Known Member

    These aren't working for me with the content in the url. Old url: http://www.aspergic.com/threads/karl-pilkington.717/

    If I take out karl-pilkington. it works.
     
  14. BamaStangGuy

    BamaStangGuy Well-Known Member

    This worked for me:

    Code:
    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^(www\.)?aspergic\.com$
    RewriteRule ^threads/[^\./]+\.([0-9]+)/ https://www.aspiescentral.com/showthread_aspergic.php?t=$1 [R=301,L]
    RewriteCond %{HTTP_HOST} ^(www\.)?aspergic\.com$
    RewriteRule ^forums/[^\./]+\.([0-9]+)/ https://www.aspiescentral.com/forumdisplay_aspergic.php?f=$1 [R=301,L]
    RewriteCond %{HTTP_HOST} ^(www\.)?aspergic\.com$
    RewriteRule ^categories/[^\./]+\.([0-9]+)/ https://www.aspiescentral.com/forumdisplay_aspergic.php?f=$1 [R=301,L]
    RewriteCond %{HTTP_HOST} ^(www\.)?aspergic\.com$
    RewriteRule ^members/[^\./]+\.([0-9]+)/ https://www.aspiescentral.com/member_aspergic.php?u=$1 [R=301,L]
     
  15. BamaStangGuy

    BamaStangGuy Well-Known Member

    How do I get pages to work for threads? This isn't working:

    Code:
    RewriteCond %{HTTP_HOST} ^(www\.)?aspergic\.com$
    RewriteRule ^threads/[^\./]+\.([0-9]+)/page-([0-9]+) https://www.aspiescentral.com/showthread_aspergic.php?t=$1&page=$2 [R=301,L]
     
  16. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That should work. Try downloading the latest version of these scripts:

    http://xenforo.com/community/resources/redirection-scripts-for-vbulletin-3-x.264/

    Older versions didn't do pages.
     
  17. BamaStangGuy

    BamaStangGuy Well-Known Member

    Hmm I downloaded fresh today.

    This is my current .htaccess:

    Code:
    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^(www\.)?aspergic\.com$
    RewriteRule ^threads/[^\./]+\.([0-9]+)/ https://www.aspiescentral.com/showthread_aspergic.php?t=$1 [R=301,L]
    RewriteCond %{HTTP_HOST} ^(www\.)?aspergic\.com$
    RewriteRule ^threads/[^\./]+\.([0-9]+)/page-([0-9]+) https://www.aspiescentral.com/showthread_aspergic.php?t=$1&page=$2 [R=301,L]
    RewriteCond %{HTTP_HOST} ^(www\.)?aspergic\.com$
    RewriteRule ^members/[^\./]+\.([0-9]+)/ https://www.aspiescentral.com/member_aspergic.php?u=$1 [R=301,L]
     
  18. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Looks fine. What happens when you visit an old URL? Does it redirect anywhere? If so, where? Or does it not redirect? Does it give an error message?
     
  19. BamaStangGuy

    BamaStangGuy Well-Known Member

  20. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Oh...

    The page redirect needs to go before the non-page redirect.
     

Share This Page