vBulletin 4.x URL Redirection

vBulletin 4.x URL Redirection 1.0.0

No permission to download
Rewrite from vb:
Code:
$HTTP["host"] == "xboxforum.pl" {
server.document-root = "/home/asd23sa23/xbox2314/"
url.rewrite-once = (
"^/((urllist|sitemap).*\.(xml|txt)(\.gz)?)" => "/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1",
"^(/(admincp|modcp|clientscript|cpstyles|images|customavatars|mobiquo|install|vbseo_sitemap|vbseo|xcacheadm)/.*)$" => "$1",
"^(/favicon\.ico|/robots\.txt|.*clear\.gif)$" => "$1",
"^/(.+)\?(.*)$" => "/vbseo.php?$2",
"^/(.+)$" => "/vbseo.php"
)
expire.url = ( "/images/" => "access 4 weeks", "/clientscript/" => "access 4 weeks", "/customavatars/" => "access 4 weeks" )

}
 
No, I mean the rules you are using to rewrite your VB links to XF, ie. yourvb/yourvbthread... to yourxf/showthread.php (the files from this modification).

Exactly as you have in your (100% working) Lighttpd configuration. Without the Xenforo SEF rules.
 
Acctual file showthread.php:
Code:
<?php

$startTime = microtime(true);

$fileDir = dirname(__FILE__);
if (file_exists($fileDir . '/301config.php'))
{
    include($fileDir . '/301config.php');
}

require($fileDir . '/library/XenForo/Autoloader.php');
XenForo_Autoloader::getInstance()->setupAutoloader($fileDir . '/library');

XenForo_Application::initialize($fileDir . '/library', $fileDir);
XenForo_Application::set('page_start_time', $startTime);

$http = new Zend_Controller_Request_Http();

$inputHandler = new XenForo_Input($http);

$input = $inputHandler->filter(array(
    't' => XenForo_Input::UINT,
    'p' => XenForo_Input::UINT
));
if(preg_match('/(?:showthread|printthread)\.php(?:\/|\?)([0-9]+)(?:-[^\/]+)/', $http->getRequestUri(), $matches) && count($matches) >= 1){   
    $input['t'] = intval($matches[1]);
}


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

$target = false;
if ($input['t'])
{
    if ($newId = $importModel->mapThreadId($input['t']))
    {
        $target = XenForo_Link::buildPublicLink('canonical:threads', array('thread_id' => $newId));
    }
}
else if ($input['p'])
{
    $newId = $importModel->mapPostId($input['p']);
    if ($newId)
    {
        $target = XenForo_Link::buildPublicLink('canonical:posts', array('post_id' => $newId));
    }
}

if (!$target)
{
    $target = XenForo_Link::buildPublicLink('canonical:index');
}

$response = new Zend_Controller_Response_Http();
$response->setRedirect(XenForo_Link::convertUriToAbsoluteUri($target), 301);
$response->sendResponse();
 
I am on the point of giving up here!

Could you post the section from your Lighttpd.conf file that rewrites your old VBulletin URLs to the showthread.php, showpost.php, attachment.php etc files from this modification. These will be from the VBSEO converter tool, added to your lighttpd.conf and then tested to make sure they work. With Xenforo SEF disabled, and no Xenforo SEF rules or lua file.

Once I have this (working) Lighttpd configuration, I might be able to compare to my own file and give you a XF SEO complete solution to try.
 
that doesn't seem to work - I think you said you had this fully working? If so can you post the working rules?

(ignore my previous edit)

edit - Are showthread, showpost etc in the same place as your old VBulletin installation? was
/jtag-rgh-194/ the old VB directory?
 
Last edited:
Forum is the some directory. /jtag-rgh-194/ is one of categories in forum.

Rewrtite dosesn't works correctly.
 
Please forgive the newbie questions.

When I imported, the URLs did not properly adjust.

I read and downloaded this addon, but HOW do I RUN it?

Please help my ignorance!

Thanks a lot guys.

Here is my 301config.php

Code:
<?php

/* ----------------------------------------------------------- *\
This variable defines where XenForo is installed.

If you have not installed XenForo into the same directory in which
vBulletin was installed, you will need to provide the full path to
the XenForo directory here. Remove the leading // and then enter
the path as in the following examples:

    $fileDir = '/home/example/public_html/new_forums';

    $fileDir = 'C:/inetpub/wwwroot/xenforo';

\* ----------------------------------------------------------- */

    $fileDir = '/home/hobbymac/public_html';

/* ----------------------------------------------------------- *\
This constant defines the table from which the import redirection
scripts will fetch their data. Normally they will use the table
'xf_import_log', but if you have archived your import data, you
should provide the name of the archive table here. Remove the
leading // and then replace 'import_log_x' with the name of your
archive table, as in the following examples:

    define('IMPORT_LOG_TABLE', 'my_import_log');

    define('IMPORT_LOG_TABLE', 'import_log_my_forums');

\* ----------------------------------------------------------- */

    define('IMPORT_LOG_TABLE', 'archived_import_log');
 
Last edited by a moderator:
I hope someone can help me here. The route direct is nearly working, but there is one "forum" to much in the link:

This is the old link (The domain will be changed later):
http://forum.scharesoft.de/showthread.php?436-Fallout-3

After trying this:
http://www.elderscrollsportal.de/showthread.php?436-Fallout-3

this link appears:
http://www.elderscrollsportal.de/forum/threads/436/

but correct would be:
http://www.elderscrollsportal.de/threads/436/

this redirects correctly to
http://www.elderscrollsportal.de/themen/fallout-3.436/

I tried this Rule, but it's not working:
RewriteRule ^/forum/threads /threads [R=301,L]
 
My old forum was in /forums/

My new forum in /forum

Do I put the contents of the upload folder in the old vbb directory (/forums/) or the new directory (/forum/) ?
 
The old directory is 100% empty, is this ok? There's no vbb files.

I put the files in the new directory and edited the config file (301config.php)

Since I am using plesk I used the full path /var/www/vhosts/mydomain/httpdocs/newfolder

Should I only use /httpdocs/newfolder or does the redirect need the entire path as root?

I did not edit the htaccess yet.
 
I have some errors at the apache log i want get them away.

[Sat Jul 04 02:38:47.262664 2015] [:error] [pid 2354] [client 208.115.113.88:51083] script '/var/www/html/pattayaforum.net/www/forum/blog.php' not found or unable to stat

[Sat Jul 04 02:39:01.430450 2015] [:error] [pid 2643] [client 208.115.113.88:58889] script '/var/www/html/pattayaforum.net/www/forum/content.php' not found or unable to stat

[Sat Jul 04 03:44:26.029712 2015] [:error] [pid 7913] [client 155.133.18.135:63377] script '/var/www/html/pattayaforum.net/www/forum/login.php' not found or unable to stat, referer: Featured Threads | Pattayaforum

[Sat Jul 04 04:55:51.302147 2015] [:error] [pid 14431] [client 157.55.39.163:50894] script '/var/www/html/pattayaforum.net/www/forum/entry.php' not found or unable to stat

[Sat Jul 04 04:32:09.906264 2015] [:error] [pid 12647] [client 219.140.127.132:59922] script '/var/www/html/pattayaforum.net/www/forum/register.p hp' not found or unable to stat, referer: h ttp: //w ww.pattayaforum.net/forum/register.php?a=act&u=13499&i=763a0bc8dca4ee22b63af28431fc81ecde50f11a

They come all from the old Forum.


Edit

The last access to register.php came from 184.173.238.122. This belongs to Xenforo.com.


[Sat Jul 04 05:34:43.548990 2015] [:error] [pid 17718] [client 184.173.238.122:37805] script '/var/www/html/pattayaforum.net/www/forum/register.php' not found or unable to stat
[Sat Jul 04 05:35:06.706381 2015] [:error] [pid 17830] [client 184.173.238.122:37921] script '/var/www/html/pattayaforum.net/www/forum/register.php' not found or unable to stat
[Sat Jul 04 05:35:21.890241 2015] [:error] [pid 17599] [client 184.173.238.122:37969] script '/var/www/html/pattayaforum.net/www/forum/register.php' not found or unable to stat
 
Last edited:
@teletubbi

"not found" errors are appropriate since you removed the old forum.

These redirect scripts only redirect the various content (threads, forums, attachments, etc).

It is possible to redirect all other traffic with some rewrite rules if you want. But first I need to know the old and new URL of your forum.
 
Top Bottom