MediaWiki Redirects

Updated on October 1, 2022

What are MediaWiki Redirects

MediaWiki has redirect support. Redirects forward users from one page name to another.

Redirects can enhance the discoverability of your pages, by adding synonym page names. They are also important to prevent links from breaking when renaming pages.

If you have a page named OriginalPage, and you rename it to NewPage, a redirect will automatically be created. This means that anyone visiting OriginalPage, for instance by following an existing link, will automatically end up on NewPage.

Changing or Removing a MediaWiki Redirect

If you wish to update or remove a redirect, go to the redirect page. This will send you to the target of the redirection, which will show "(Redirected from OriginalPage)" right below the page title.

MediaWiki page showing that a redirect happened

Clicking the OriginalPage link leads you to the redirect page itself. You will no longer be redirected due to the &redirect=no URL parameter.

A MediaWiki redirect page

Once you are on the redirect page proper, you can delete the redirect by deleting the page. Or you can modify the redirect target by editing the page. Look for #REDIRECT [[NewPage]], and replace NewPage with your new redirect target.

Adding a Redirect to MediaWiki

  1. Create a new page, for instance MyRedirect.
  2. Add #REDIRECT [[NewPage]] as content.
  3. Save the page

Anyone visiting MyRedirect will now automatically be redirected to NewPage.

The MediaWiki source editor showing a redirect page