• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Redirection Scripts for vBulletin 3.x

Status
Not open for further replies.
Not any more :)
Seems to have some issue with archived using the latest version (v3) of your script.

One of the archived link here (got it from Google cache)
http://webcache.googleusercontent.c...d=9&hl=en&ct=clnk&gl=us&source=www.google.com

Which links to the full url http://www.quantnet.com/forum/showthread.php?t=6248
Which redirects properly to the current XF url http://www.quantnet.com/forum/threads/consulting-career-columbia-msor-vs-stanford-ms-e.3546/

However, the archived url http://www.quantnet.com/forum/archive/index.php/t-6248.html generates 404.
 
Andy, if you open a support ticket with SSH details for your server I'll see if I can work out what's going on there.
 
Edit: Attachement support is now in v4 of the import script attached to the first post.

Attachment Mapping Support

Users on my imported VB forum have sometimes linked directly to attachments in posts, sometimes from other posts which don't contains the attachment. Typically this looks like

VB attachment wrapped in img tags:
[IMG]http://example.com/forum/attachment.php?attachmentid=1637&d=1244503530[/IMG]

In Xenforo 1.0.0 this will result a broken image in the post.
The xf_import_log table contains mappings for attachment id's which we want to use to fix the above to reference XF's new attachment id.

XF imported attachment looks like:
http://example.com/forum/attachments/n598335379_802278_7252-jpg.1173/

Upload attachment.php and place it with the other redirection scripts where the vBulletin files with the corresponding names would be located.

edit: library/XenForo/Model/Import.php
add before: public function mapNodeId($id, $default = null)

PHP:
        public function mapAttachmentId($id, $default = null)
        {
                $ids = $this->getImportContentMap('attachment', $id);
                return ($ids ? reset($ids) : $default);
        }

Kier feel free to fix and add the above to your redirect scripts since it's almost entirely your code anyway ;)

I've just attached version 3 of this system, which includes redirects for the vBulletin archive.

Also worth noting, for version 3's archive/index.php to work then you must set $fileDir in 301config.php to your XF installation otherwise:

archive/index.php: require($fileDir . '/library/XenForo/Autoloader.php')

Will fail since it's trying to reference archive/library/... and it's unlikely your XF installation resides within your archive/ directory.
 

Attachments

inph is right about the archive requiring $fileDir to be specified - I am fixing that now.

I'll also look at implementing printthread.php and attachment.php.
 
I'm not sure if the archive redirection is working, for example here are my archive links from my old vBulletin forum

http://www.google.co.uk/#sclient=psy&hl=en&site=&source=hp&q=site:smsmasters.co.uk smsmasters archive

However, it just redirects to the forum root.
I'm a little confused as to why your archive links show /archive/index.php/index.php?t-1.html when the archive as I remember it used /archive/index.php/t-1.html... do you have an unusual server setup?
 
I'm a little confused as to why your archive links show /archive/index.php/index.php?t-1.html when the archive as I remember it used /archive/index.php/t-1.html... do you have an unusual server setup?

I'm not quite sure, but it's okay; must be a glitch on my old forum.
 
I have this at my website root in .htaccess

Code:
DirectoryIndex index.php
RewriteEngine on

RewriteCond %{HTTP_REFERER} !^http://smsmasters.co.uk/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://smsmasters.co.uk$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.smsmasters.co.uk/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.smsmasters.co.uk$      [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]

and an index.php at the root with this


Code:
<?php
header('Location: http://www.smsmasters.co.uk/forum/portal/', true, 301);
?>
 
That would suggest that those threads have either not imported correctly, or there is no record of their having been imported.

Can you see a record for thread 109722 in your xf_import_log table?
 
Status
Not open for further replies.
Top Bottom