Extension:MigrateMyLinks

Category:Extensions without an imageCategory:MIT licensed extensions
MediaWiki extensions manual
MigrateMyLinks
Release status: stableCategory:Stable extensions
Implementation User interfaceCategory:User interface extensions
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.Category:Extensions with master compatibility policy
MediaWiki Category:Extensions without MediaWiki version
License MIT License
Download Category:Extensions in GitHub version control
  • $wgMigrateMyLinksDomain
  • $wgMigrateMyLinksMaxRevisionId
Category:All extensions

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

  • 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.
Category:All extensions Category:Extensions in GitHub version control Category:Extensions with master compatibility policy Category:Extensions without MediaWiki version Category:Extensions without an image Category:InternalParseBeforeLinks extensions Category:LinkerMakeExternalLink extensions Category:MIT licensed extensions Category:ParserAfterParse extensions Category:Stable extensions Category:User interface extensions