Redirects using .htaccess


Andy

Administrator
If you have migrated from another forum software, you will want to redirect old links to your XenForo forum.

Your new RewriteRule should be placed where the red arrow is pointing:

1595867525341.png
 

Andy

Administrator
Here is a RewriteRule to redirect threads from vBulletin which used an add-on called VBSEO.

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
Here is a RewriteRule to redirect post links from vBulletin which used an add-on called VBSEO.

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

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

PHP:
<?php

$p = $_GET['p'];

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