Resource icon

Redirection Scripts for vBulletin 3.x 8.0

No permission to download
Three weeks later and I just realized I forgot to set up redirects for my vb3 archive directory. I copied the file in but am getting server errors. I'm guessing I need to fix the rewrite for it since it's using vbseo. If I post a sample URL would someone be able to help me with the rewrite code?

http://www.dsmtuners.com/forums/archive/index.php/f-4-p-129.html

Thanks in advance.

Need the new URL for the same thread as well.

What is the error? Might need this fix:

http://xenforo.com/community/threads/archive-re-directs.25457/#post-308580
 
Need the new URL for the same thread as well.

What is the error? Might need this fix:

http://xenforo.com/community/threads/archive-re-directs.25457/#post-308580
Hi Jake, the index.php file already has that fix in it. Here's one of the errors being logged - there are several different errors, all related to vbseo:

HTML:
ErrorException: ob_end_clean() [<a href='ref.outcontrol'>ref.outcontrol</a>]: failed to delete buffer. No buffer to delete - forums/vbseo.php:176
Generated By: Unknown Account, A moment ago
Stack Trace
#0 [internal function]: XenForo_Application::handlePhpError(8, 'ob_end_clean() ...', '/home/dsmtuner/...', 176, Array)
#1 /home/site/public_html/forums/vbseo.php(176): ob_end_clean()
#2 {main}
Request State
array(3) {
["url"] => string(64) "http://www.dsmtuners.com/forums/archive/index.php/f-4-p-180.html"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
 
Any ideas on the error? I'm wondering if I should just pull the redirect file and forget the redirect for archives.
 
Any ideas on the error? I'm wondering if I should just pull the redirect file and forget the redirect for archives.

That error names vbseo.php. vBSEO should probably be deleted from your server.

If you post an example old and new URL for the archives then I can provide rewrite rules for the redirect.
 
If I delete vBSEO wouldn't it mess up the old site links that are indexed in google?

Ideally you would be using a redirect method which directly redirects the old URLs such that vBSEO is not needed.

This is the old link:
http://www.dsmtuners.com/forums/archive/index.php/f-4-p-129.html

Here is the link structure of a random thread on the new site:
http://www.dsmtuners.com/threads/major-changes-coming-to-dsmtuners.475739/

Is that what you need?

I need the old and new URL of the same content (e.g. thread). Then I can construct rewrite rules for you.
 
Ideally you would be using a redirect method which directly redirects the old URLs such that vBSEO is not needed.
Jake, can you explain how this would work for a site that was using vBSEO?

I need the old and new URL of the same content (e.g. thread). Then I can construct rewrite rules for you.
Here's a link to an old thread in the archive:
http://www.dsmtuners.com/forums/index.php/newbie-forum/371342-carbon-build-up-exhaust.html

And here's where it is in XF:
http://www.dsmtuners.com/threads/carbon-build-up-on-exhaust.371342/
 
Jake, can you explain how this would work for a site that was using vBSEO?

You asked if old links would be affected by removing vBSEO. I can't say for sure, but probably not, as it is unlikely your redirects depend on having vBSEO installed.


I assume you have removed the old /forums directory.

Add these rules to the top of the .htaccess file in your web root:

Code:
RewriteEngine On

RewriteRule ^forums/index\.php/[^/]+/([0-9]+)-[^\.]+\.html$ /threads/$1/ [R=301,L]

That should do it.
 
I have not removed the old /forums directory yet. It's still there, as I still have a few custom features I am referencing as I try and reproduce them in XF. I'll look at disabling and removing vBSEO and will try out your rewrite code. Thanks Jake.
 
I edited all the files to work for both vb3 & vb2 links.if anyone needs htem I'd be happy to provide the edits

I still have vb2 links hanging around, which I'd also like to redirect. Would you (or anybody else) please provide me with the modifications required to make these great redirection scripts work for both links types, as you described below?


Thanks a bunch in advance!
 
I still have vb2 links hanging around, which I'd also like to redirect. Would you (or anybody else) please provide me with the modifications required to make these great redirection scripts work for both links types, as you described below?



Thanks a bunch in advance!

Adding the red code to showthread.php should do it:

Rich (BB code):
$input = $inputHandler->filter(array(
	't' => XenForo_Input::UINT,
	'p' => XenForo_Input::UINT,
	'threadid' => XenForo_Input::UINT,
	'postid' => XenForo_Input::UINT
));

$input['t'] = ($input['threadid'] ? $input['threadid'] : $input['t']);
$input['p'] = ($input['postid'] ? $input['postid'] : $input['p']);

$importModel = XenForo_Model::create('XenForo_Model_Import');

$target = false;
if ($input['t'])
{
 
Thanks a lot, Jake! I really appreciate it! (y)

Both redirects are now working fine, to VB2 and VB3 URL formats.

Just a thing, I believe there's a comma missing at the end of this line, which I added myself, as not having it broke the script:

Code:
        'postid' => XenForo_Input::UINT,

Anyway, thanks again! Cheers!
 
Hi All.

I'm trying to get some redirects working for a couple of sites, and I've become quite confused; I'm grateful for any help offered in clearing-up my thinking!

I have one ex-VB3 site which has been moved to XF (Site A).
I have one VB4 site, running vBSEO which is about to be moved to XF (Site B).

Site A doesn't have any redirects in place for old links at the moment; I was hoping to use it as a testbed to make sure I know how to get Site B's links working before we switch front-of-house over to XenForo.

I was thinking that I could configure redirect scripts on Site A with Site B's link structure, then browse to an URL formatted as Site B (but with a valid Site A thread ID), and if all's well I should see an XF thread. To be honest though, if I can be confident I've got the config. right for Site B vB -> Site B xF, the ex-VB3 site can be dealt with separately later.

The rewrite rule format I'm working with is:
Code:
RewriteEngine on
RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]

Thread and post IDs in our XF install match those in our VB4 install, and we're going from domain.tld/vb/ to domain.tld/xf/ - I'm just not sure quite how to tie it all together. It appears that coming from a VB4 install with vBSEO, I should use these VB 3.x redirects, is that right? Perhaps I should be using the VB4 ones, or a combination of the two?

Sincerely grateful for any and all pointers!

A
 
@Adam Bloch

Please provide a specific example of an old and new thread URL (for the same thread). Then I can provide instructions.

The vB3 and and vB4 redirect scripts are mostly the same and are mostly interchangeable. Fundamentally they just serve to map the old ids to the new ids. But for "friendly" URLs you sometimes need rewrite rules in addition. I can determine this if you provide example URLs for the same thread.
 
@Jake Bunce

Thanks for your offer of help. Apologies for my guff relating to the ex-vB3 site, I realise that's just pointless complication. I'll try to figure out that site's own URLs separately for myself. For our vB4 (& vBSEO) site then:

domain.tld/vb/general-chat/23724-word-association-game.html
Becomes:
domain.tld/xf/index.php?threads/word-association-game.23724/

I don't know how likely we are to get pagination working?

domain.tld/vb/general-chat/23724-word-association-game-2.html
domain.tld/xf/index.php?threads/word-association-game.23724/page-2

Thanks,

A
 
Top Bottom