• 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

AWS

Well-known member
#1
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?
 

Liam W

Well-known member
#2
No, there isn't in any way, as the content ID's will be completely different, as there was already content present.

Liam
 

Alfa1

Well-known member
#5
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.
 

Brogan

XenForo moderator
Staff member
#6
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.
 

AWS

Well-known member
#7
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.
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.
 

Brogan

XenForo moderator
Staff member
#8
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.
 

Jake Bunce

XenForo moderator
Staff member
#9
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.
 

Jake Bunce

XenForo moderator
Staff member
#11
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.
 

Brent W

Well-known member
#13
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.
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.
 

Brent W

Well-known member
#14
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]
 

Brent W

Well-known member
#15
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]
 

Jake Bunce

XenForo moderator
Staff member
#16

Brent W

Well-known member
#17
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.
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]
 

Jake Bunce

XenForo moderator
Staff member
#18
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]
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?