Topic Links 2.2 Archive Fix
For large-scale archives, the PHP or .htaccess fix alone may not be sufficient. Links may be stored incorrectly inside posts or in search engine indexes.
Before applying the fix, confirm that your installation suffers from the classic Topic Links 2.2 bug.
RewriteCond %REQUEST_FILENAME !-f RewriteCond %REQUEST_FILENAME !-d RewriteRule ^t-([0-9]+)(.html)?$ index.php?t=$1 [L,NC,QSA]
In the sprawling history of internet forums, few platforms have had as lasting an impact as vBulletin. For over two decades, it powered millions of communities, from niche hobby groups to massive tech support hubs. However, as with any legacy software, administrators and archivists face a recurring nightmare: broken functionality. Among the most infamous of these issues is the "Topic Links 2.2 Archive Fix," a specific patch required for older vBulletin versions (pre-3.0) that affects how archived threads and post links are generated and accessed.
If you are managing a legacy forum, migrating old data, or trying to restore a historical archive, you have likely encountered dead-end URLs, 404 errors, or incorrectly parsed thread links. This article provides a deep dive into what the Topic Links 2.2 Archive Fix is, why it breaks, and—most importantly—how to implement the fix step by step. Topic Links 2.2 Archive Fix
RewriteRule ^t-([0-9]+).html.html$ t-$1.html [R=301,L]
If you have access to an unpatched archive/ folder from the original distribution, the bug will be present by default. The fix was never included in the official 2.2 release—only in later custom patches.
RewriteRule ^t-([0-9]+)$ t-$1.html [R=301,L]
This method catches the broken patterns and redirects them to the corrected PHP handler. For large-scale archives, the PHP or
This patch modifies the archive/global.php and archive/index.php files.
Backup first: Always create backups of your archive directory.
Step 1: Edit archive/global.php
Find the function construct_archive_link (around line 120). Original code often looks like: This method catches the broken patterns and redirects
function construct_archive_link($threadid)
return "index.php/t-".$threadid.".html";
Replace it with:
function construct_archive_link($threadid)
global $vboptions;
// Fix for double extension and malformed links
$link = "index.php/t-" . intval($threadid);
if ($vboptions['archiveext'] == '.html')
$link .= ".html";
return $link;
Step 2: Edit archive/index.php
Find the line that parses the PATH_INFO or QUERY_STRING (usually near line 45). Look for:
$threadid = intval(substr($QUERY_STRING, 2));
Change it to:
// Topic Links 2.2 Archive Fix - Improved parsing
$path = getenv('PATH_INFO');
if ($path && preg_match('#/t-([0-9]+)(\.html)?#i', $path, $matches))
$threadid = intval($matches[1]);
else
$threadid = intval(substr($QUERY_STRING, 2));
Step 3: Save and Test
Upload the modified files, clear your browser cache, and test a topic link. It should now resolve correctly.