Redirect

From PortlandWiki
Jump to navigation Jump to search

A redirect is a technical feature in Mediawiki software. Redirects automatically point a web browser from one page to another; it's sort of like a "shortcut" or "alias" on a desktop computer.

For instance, on our wiki, we might have a page called doodle.com. That's the name of a web service. But sometimes, a person might type "doodle" into the search bar, or a page might link directly to doodle.

That's where a redirect comes in: in both cases, we know that the intent is to read about doodle.com. So we set up a redirect at

(The preceding link is set up in a special way, that lets you see the redirect itself instead of being redirected; click it and see what happens!)

How to make a redirect

Making a redirect is pretty easy.

Create a new page, and enter the following text:

#REDIRECT [[Name of target page]]

So for example,

#REDIRECT [[doodle.com]]

That's it!

Soft redirects

There's also the notion of a "soft redirect." This is a less technical feature.

An example of a soft redirect would be if I made a page at Doodlesoft with the following text:

Doodlesoft is a pretty uncommon name for [[doodle.com]].

That would inform the reader that there is another page to click on, but also give them a little information about why they weren't automatically taken there.

How to undo or change a redirect

Altering a redirect, once it's been created, can be a little tricky -- because when you try to navigate to the redirect page, it redirects you!

There are two ways to get around this: by clicking, or by directly typing the exact address of the page into the browser's URL window.

I'll use this sample redirect as an example.

  • Clicking: after you click on sample redirect, it will take you back to this page. But notice the small text immediately below the page title. It says "redirected from sample redirect." If you click on "sample redirect" again, it will take you to the redirect page itself; then you can click edit, and change the redirect.
  • Typing in the address: Occasionally, it's easier to just type in the address directly. Here's how: for the example above, the address would be: http://pdx.wiki.org/index.php?title=Sample_redirect&redirect=no

Disambiguation

Disambiguation is a fancy kind of soft redirect that gives the reader some choices about where they want to go. See disambiguation.

More advanced redirect tips

It's a teensy bit more complex with some special pages. If I want to make a redirect to Category:Tools, I'd do it as follows. Note the colon (:) right after the double brackets:

#REDIRECT [[:Category:Tools]]

You might want to just get into the habit of using the colon all the time, even when linking or redirecting to an ordinary page. It makes no difference with ordinary pages.

Another advanced concept: there's a system that allows one wiki to link to another with wiki syntax. It's not terribly relevant to the Dreamfish wiki, but it's kinda cool: each wiki stores a set of shortcuts to other wikis. (This is buried in the software somewhere.) In our case, the English Wikipedia is one of those. To link to the Wikipedia article on France, you can just do the following: wikipedia:France. You can do a redirect the same way! (Otherwise, it's impossible to redirect to other web sites; this is the only way around it.)