---
title: "Adding and removing redirects in MediaWiki"
description: "When renaming, deleting and restoring pages in MediaWiki, it is necessary to know how to redirect URL's that are no longer working. When visitors bookmark pages or Google caches your old pages, they..."
url: https://www.inmotionhosting.com/support/edu/mediawiki/add-remove-redirect-wiki/
date: 2013-01-22
modified: 2021-08-16
author: "InMotion Hosting Contributor"
categories: ["MediaWiki"]
type: post
lang: en
---

# Adding and removing redirects in MediaWiki

When renaming, deleting and restoring pages in MediaWiki, it is necessary to know how to redirect URL's that are no longer working. When visitors bookmark pages or Google caches your old pages, they will get a "*404 not found*" error when looking for the old link. This makes it necessary to create a redirect in that page to have it go to another valid page. This article will outline how to add and remove redirects in your MediaWiki pages.

## Adding a redirect to MediaWiki

1. [Log into MediaWiki](/support/edu/mediawiki/login-username-password/).
2. **Select the page you want to redirect.**
3. **Add the redirect code to the page.**The redirect code will look like the following: `#REDIRECT []` In this case we will use the following to redirect to the "*HTML Wiki for Beginners Home page*". The code will look like the following: `#REDIRECT []` [![Wrong place for code MediaWiki](https://www.inmotionhosting.com/support/wp-content/uploads/2013/01/edu_mediawiki_102_redirects_redirect-1-wrong-place.gif)](/support/wp-content/uploads/2013/01/edu_mediawiki_102_redirects_redirect-1-wrong-place.gif) **Important!** If you place the redirect code in the incorrect place, See image to the right, the redirect will not work. [![Broked redirect MediaWiki](https://www.inmotionhosting.com/support/wp-content/uploads/2013/01/edu_mediawiki_102_redirects_redirect-2-broke.gif)](/support/wp-content/uploads/2013/01/edu_mediawiki_102_redirects_redirect-2-broke.gif) You will get a page like the snapshot to the right if the code is places in teh wrong location of the page. The Redirect code must be placed at the top of the page before all text in the page. [![Correct redirect code MediaWiki](https://www.inmotionhosting.com/support/wp-content/uploads/2013/01/edu_mediawiki_102_redirects_redirect-3-correct.gif)](/support/wp-content/uploads/2013/01/edu_mediawiki_102_redirects_redirect-3-correct.gif) Once you add the redirect code to the top of the page like the image to the right, **Save the page.**
4. [![Correct redirect in MediaWiki](https://www.inmotionhosting.com/support/wp-content/uploads/2013/01/edu_mediawiki_102_redirects_redirect-4-correct-redirect.gif)](/support/wp-content/uploads/2013/01/edu_mediawiki_102_redirects_redirect-4-correct-redirect.gif) **Visit the page to check if the redirect is working**. The page should load with a redirect message saying "*Redirect Page*" with the page name the redirect points to.

## Removing a redirect in MediaWiki

1. [Log into MediaWiki](/support/edu/mediawiki/login-username-password/).
2. **Find the page you want to edit** by going to special pages on the left in the navigation sidebar. Select "*All pages*" in the "*Lists of pages*" section. Find the page and selct it.
3. [![Edit page to remove redirect MediaWiki](https://www.inmotionhosting.com/support/wp-content/uploads/2013/01/edu_mediawiki_102_redirects_redirect-5-remove-redirect.gif)](/support/wp-content/uploads/2013/01/edu_mediawiki_102_redirects_redirect-5-remove-redirect.gif) **Click the Edit link** at the top left.
4. [![Delete redirect code MediaWiki](https://www.inmotionhosting.com/support/wp-content/uploads/2013/01/edu_mediawiki_102_redirects_redirect-6-delete-redirect.gif)](/support/wp-content/uploads/2013/01/edu_mediawiki_102_redirects_redirect-6-delete-redirect.gif) **Find the redirect code and delete it.** Now the page will no longer redirect.
