Jump to content

Extension:MigrateMyLinks

From mediawiki.org
MediaWiki extensions manual
MigrateMyLinks
Release status: stable
Implementation User interface
Description Rewrites external links pointing to your wiki after moving a wiki to another host
Author(s) Jesús Martínez (Ciencia Al Podertalk)
Latest version 1.0.0
Compatibility policy Master maintains backward compatibility.
MediaWiki
License MIT License
Download
  • $wgMigrateMyLinksDomain
  • $wgMigrateMyLinksMaxRevisionId

The MigrateMyLinks extension rewrites external links pointing to your wiki after moving a wiki to another host.

When a page contains external links pointing to a defined host, it rewrites them (only when viewing the page, not when editing) so they point to the current URL of the wiki instead.

This is useful when people post external links pointing to the own wiki on talk pages and such, and then you move your wiki to another URL. Without this extension, those links would be pointing to an old URL, often not accessible or outdated. This extensions rewrites those links to point to the current wiki URL.

Installation

[edit]
  • Download and place the file(s) in a directory called MigrateMyLinks in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'MigrateMyLinks' );
    # RevisionID to stop rewriting URLs.
    # Set to -1 (the default) to rewrite all links
    # Page revisions after this revision won't have the links rewritten
    $wgMigrateMyLinksMaxRevisionId = -1;
    # Domain to rewrite links from, don't include protocol nor slashes
    $wgMigrateMyLinksDomain = 'www.oldwikisite.com';
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.