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

XF 1.1 Need help with redirect from vB4.2 with vBSEO

Renegade

Well-known member
#1
The co-admin that I was depending on to set this up ditched me last minute and I need to setup the redirects myself.

So far I have gone to this page and uploaded by VBSEO settings file ->http://tools.geekpoint.net/xfseo/

This is the output


Thread Paging
RewriteRule [^/]+/.+-([\d]+)/p([\d]+)/ showthread.php?t=$1&page=$2 [NC,L]
Thread
RewriteRule [^/]+/.+-([\d]+)/ showthread.php?t=$1 [NC,L]
Forum Paging
Unsupported url format.
Forum
Unsupported url format.
Copy the rewrite rules given below to your .htaccess file in the same directory where you have placed showthread.php and forumdisplay.php files provided by Kier: Redirection Scripts for vBulletin 3.x. If you already have some rewrite rules in that .htaccess file, place these near the top.

Can someone please spoon feed me this one time so that I am able to set this up.
Also if I am using VBSEO then do I need to use the following anywhere?
http://xenforo.com/community/threads/redirection-scripts-for-vbulletin-3-x.5030/
http://xenforo.com/community/resources/vbulletin-4-x-url-redirection.120/
 

Renegade

Well-known member
#2
Alright the redirects are setup now it is taking to the correct thread. However the pages within a thread are still not working. A page X from VB URL is taking to the page 1 of XF URL.
 

Jake Bunce

XenForo moderator
Staff member
#3
Alright the redirects are setup now it is taking to the correct thread. However the pages within a thread are still not working. A page X from VB URL is taking to the page 1 of XF URL.
Those redirect scripts don't do page numbers. Is your XF forum showing the same number of posts per page as your vB forum? Otherwise the page numbers won't match up so it would not be appropriate to redirect them. But if you want to include page numbers in the redirects then edit the showthread.php file and add the red code:

Code:
if ($input['t'])
{
	if ($newId = $importModel->mapThreadId($input['t']))
	{
		$target = XenForo_Link::buildPublicLink('canonical:threads', array('thread_id' => $newId), array('page' => max(1, $inputHandler->filterSingle('page', XenForo_Input::UINT))));
	}
}
Untested, but that should work with your rewrite rules.
 

Renegade

Well-known member
#4
Thanks for your reply. :)

Yes the number of posts per page is same in both the places. Are you saying that the redirects in Kier's script are not supposed to honor page numbers. Won't that be counter productive for visitors coming from the search engine?

I tried your method but it does not take me to the correct page. Still the first page of the thread. :(

if ($newId = $importModel->mapThreadId($input['t']))
{
$target = XenForo_Link::buildPublicLink('canonical:threads', array('thread_id' => $newId), array('page' => max(1, $inputHandler->filterSingle('page', XenForo_Input::UINT))));
 

Renegade

Well-known member
#8
I tried changing the directory but it isnt working now. It seems that the 301 redirect file from Kier is not passing the directoy path in the URL. When I insert it manully in the translated URL, the link works.
 

Jake Bunce

XenForo moderator
Staff member
#11
Sooo... he had everything setup correctly, but his browser had cached the redirect so he wasn't seeing the changes take effect. I often have this problem with Firefox, so I use Chrome to test redirects and changes to .htaccess files.
 

Moddis

Active member
#13
Those redirect scripts don't do page numbers. Is your XF forum showing the same number of posts per page as your vB forum? Otherwise the page numbers won't match up so it would not be appropriate to redirect them. But if you want to include page numbers in the redirects then edit the showthread.php file and add the red code:

Code:
if ($input['t'])
{
if ($newId = $importModel->mapThreadId($input['t']))
{
$target = XenForo_Link::buildPublicLink('canonical:threads', array('thread_id' => $newId), array('page' => max(1, $inputHandler->filterSingle('page', XenForo_Input::UINT))));
}
}
Untested, but that should work with your rewrite rules.
Just tested and the thread pagination fix works fine.

Thanks.