Topic Links 2.2 Archive Fix < NEWEST >

Find the function construct_archive_link (around line 120). Original code often looks like:

UPDATE post SET pagetext = REGEXP_REPLACE(pagetext, 'archive/index.php/t-([0-9]+)\.html\.html', 'archive/index.php/t-\\1.html', 1, 0, 'i'); If you have migrated to a new platform, generate a map from old archive URLs to new ones. Use a simple script to loop through all thread IDs and output: Topic Links 2.2 Archive Fix

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. 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. Find the function construct_archive_link (around line 120)

http://yourforum.com/forum/archive/index.php/t-1234.html This article provides a deep dive into what

The original URL structure looked something like this:

Create or edit .htaccess in your archive/ directory:

RewriteEngine On RewriteBase /forum/archive/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^t-([0-9]+)(.html)?$ index.php?t=$1 [L,NC,QSA] Fix for double .html.html RewriteRule ^t-([0-9]+).html.html$ t-$1.html [R=301,L] Fix for missing .html extension RewriteRule ^t-([0-9]+)$ t-$1.html [R=301,L]