Redirect from vB4 to XenForo


Andy

Administrator
Staff member
This process assumes you're using the Basic Friendly URL type:

vB4 URL types:

Standard URLs: showthread.php?t=12345
Basic Friendly URLs: showthread.php?1234-Thread-Title
Advanced Friendly URLs: showthread.php/1234-Thread-Title
Mod Rewrite Friendly URLs: threads/1234-Thread-Title

The following redirect script called showthread.php needs to be created and added to the folder where your XenForo is installed. Adjust the URL as needed for your forum domain.

Code:
<?php

$part = "$_SERVER[REQUEST_URI]";

if (preg_match('/[?]\d+/', $part, $match))
{
    $t = ltrim($match[0], '?');
}

if (!empty($t))
{
    header ('Location: https://www.example.com/threads/' . $t . '/',TRUE,301);
}
 

Similar threads

Top