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.

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:

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. Topic Links 2.2 Archive Fix

RewriteCond %REQUEST_FILENAME !-f RewriteCond %REQUEST_FILENAME !-d RewriteRule ^t-([0-9]+)(.html)?$ index.php?t=$1 [L,NC,QSA]

To understand the fix, you first need to understand the problem. In vBulletin 2.2.x (released in the early 2000s), the software used a specific URL structure for its "archive" system. The archive was a stripped-down, text-only version of the forum designed for search engine crawlers and slow internet connections.

The original URL structure looked something like this:

http://yourforum.com/forum/archive/index.php/t-1234.html

Here, t-1234 referred to "thread ID 1234." However, a bug existed in the 2.2 branch where the topic links—the hyperlinks connecting posts within the archive—would point to incorrect or malformed destinations. Common symptoms included: For large-scale archives, the PHP or

This issue became so widespread that the community coined the term "Topic Links 2.2 Archive Fix" to describe the collection of code patches and .htaccess rewrites needed to resolve it.

You might think, "That's ancient history. Nobody uses Topic Links 2.2 anymore."

You'd be wrong.

The "Topic Links 2.2 Archive Fix" isn't just about fixing URLs. It's a reminder that proprietary compression is the enemy of preservation.