Redirects using .htaccess


Andy

Administrator
Staff member
Instructions for redirecting from vB4 to XenForo

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
 

Andy

Administrator
Staff member
RewriteRule should be placed where the red arrow is pointing:

1595867525341.png
 

Andy

Administrator
Staff member
RewriteRule for vB4 Advanced Friendly URLs.

RewriteRule ^[^/]+/([0-9]+)-[^\./]+\.html$ /showthread.php?t=$1 [NC,L]

This requires a file called showthread.php to be located in the public_html folder. Replace domain.com with your forum URL.

PHP:
<?php

$t = $_GET['t'];

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

Andy

Administrator
Staff member
If your VBSEO URL structure is:

http://example.com/directory-name/12345.htm

The Rewrite Rule would be:

RewriteRule ^[^/]+\/([0-9]+).*$ /showthread.php?t=$1 [NC,L]
 

Similar threads

Top