Sometimes you need to have a page that redirects to another page, or to a section of another page. This article describes how to create redirects.

Creating a redirect

Redirects may be needed if a page is merged into another page at some point after its creation, for example. To create a redirect, click the redirect button in the toolbar, which looks like this: .

This brings up a dialog box asking for the name of the destination document and its URL. The name isn't incredibly important; it's mostly useful if you're looking at the redirect page itself and want to know what you're redirecting to. The URL must be a full path from the base of the site, like "/en-US/docs/foo". Relative URLs will not work. However, you can specify a section within the target page using a hashmark ("#") character, such as "/destination/url/here#section_name". This lets you redirect the user straight to that section of the target page.

The redirect should be the only content on the page; before creating your redirect, move all content to its new home. Also, clear any review flags on the original page, to avoid having a mysterious entry in the needs-review listings.

Note: Most importantly, remove all tags from redirect pages. If you don't, the redirect page will show up in search results along with the destination page (assuming they have the same tags), confusing readers and using up valuable space in the search results page. This may also negatively impact SEO.

When deleting pages

Before asking for a page to be deleted, consider whether it would be better to turn the page into a redirect to another page on MDN. If a user comes to the page due to an old link, it's better to send them to the right page on the site than to have them get a 404 ("page not found") error. Outright deletion of pages is a last resort, typically reserved for spam and other wholly inappropriate content.