Help talk:Redirects

Discuss Help:Redirect page here:

Dynamic Redirect Using a Template
I would like to do the following:
 * 1) REDIRECT

This can be useful in many situations ie you can have one page that has only the text name of the US president, lets call that page PUSA, and then the article "United States" can reference that page and also the page "President Of The United States" would redirect automatically using: #REDIRECT

This doesn't work for me currently on mediawiki 13.

--80.179.206.193 15:06, 24 June 2009 (UTC)

Template variables
The following is also not possible, which is a shame. So you cannot move redirects or documentation to a new version.
 * 1) REDIRECT Something where = Version4

217.149.140.2 13:13, 4 October 2010 (UTC)

Redirect to an external website
How do you redirect to an external website ?

I would love to be able to make an image clickable to an external website.

--83.209.82.108 - 11:44, 24 December 2007


 * I don't think this question really relates to redirecting. You want to link, to an external website, and you want to create a click-able image. See Help:Links. You can't easily make an image clickable, though is it possible using rather ugly Template:Click tricks. A straightforward text link appearing below an image, is more easily do-able with normal wiki text.
 * If you are interested in redirecting to external websites. Well you can't do that either. It's not really the kind of thing the wiki syntax is designed to let you do. Part of the reason might be that it would be too easy to abuse.
 * -- Harry Wood 14:55, 24 December 2007 (UTC)

Only if your Wiki is in Intranet use and you are NOT worried about security: alfa

 document.location.href=document.getElementById('redirectme').href --Analienholakres3 12:19, 22 December 2008 (UTC)

interwiki example
Example with MySQL to enable a redirect to a forum, using interwiki: INSERT INTO interwiki (iw_prefix, iw_url, iw_local, iw_trans) VALUES ("helpforum", " http://www.mysite.com/forum/ ", 1, 0); Then you can put the redirect tag in the Help page in the sidebar:
 * 1) REDIRECT helpforum:

redirect seems to work if it's the first thing on a page
we can store other information below the redirect line, and only see it when clicking on the back link from the redirected target page peblusto 11:41, 28 December 2007 (UTC)

Viewing a redirect
i propose the following rewording for this section Help:Redirects peblusto 11:41, 28 December 2007 (UTC):

After creating a redirect, the wiki automatically redirects a browser to the target page. However there is a link displayed near the top of the target page. Click this to go to the redirecting page. On the redirecting page, you can do all the things that any other wiki page allows. You can go to the associated discussion page to discuss the redirect. You can view the history of the page before the redirect was put in place. You can edit and change the redirect, and you can revert to an older version to remove the redirect.

How I can redirect the page to an external page?
This comment not same as the 1st comment about, what I needs is when a user click on the About at the footer, it will open the About page, then redirect to my existing about in an other site. And also many other link content is existed in my other sites.

I know I can do it by editing the script code, but I would like to let it as is and using redirect for this purpose, so anytime I want to change the location of content, I just needs to change the redirect, no needs to go to the script code, edit and upload it again.

Regards,

117.5.159.152 02:26, 26 February 2008 (UTC)

Redirecting images
Hi! We were redirecting some images (icons) to articles, but it seems the behaviour changed in the current version; the redirects are just shown now and not applied. Bug or feature? For us it was very nice to be able to redierct images. Hum. 79.193.235.2 21:39, 12 May 2008 (UTC)


 * Yes, the same thing has happened to me. My whole wiki is based on redirected images and now they don't work!  What to do?:  See http://www.queenstown.net.nz/index.php?title=Activities for example.  --203.118.172.243 02:23, 13 May 2010 (UTC)
 * Since version 1.13, the redirection of image pages is really messy... I need to hack the code to make it work.
 * In "includes/Wiki.php" (line ~313 in 1.16a2), you have to change this part :

// Namespace might change when using redirects // Check for redirects ... $file = ($title->getNamespace == NS_FILE) ? $article->getFile : null; if( ( $action == 'view' || $action == 'render' ) 	// ... for actions that show content			&& !$request->getVal( 'oldid' ) &&   // ... and are not old revisions			$request->getVal( 'redirect' ) != 'no' &&	// ... unless explicitly told not to			// ... and the article is not a non-redirect image page with associated file			!( is_object( $file ) && $file->exists && !$file->getRedirected ) ) {

to :

// Namespace might change when using redirects // Check for redirects ... $file = ($title->getNamespace == NS_FILE) ? $article->getFile : null; if( ( $action == 'view' || $action == 'render' ) 	// ... for actions that show content			&& !$request->getVal( 'oldid' ) &&   // ... and are not old revisions			$request->getVal( 'redirect' ) != 'no' ) { --77.197.127.63 23:54, 29 May 2010 (UTC)

Many thanks, that worked beautifully. --203.109.209.190 03:30, 9 June 2010 (UTC)

Redirection import
When we use the mass import special page, if the content of a page is a redirection, it isn't considered this way (just as plain text): to be "recognized", you have to edit and save each page manually (no need to change its content).

It is the same when we try to save afterwards the page with some test extensions to bypass this problem (for exemple using doEdit method of class Article).

Has anyone found a way either to import redirection pages (and have them directly recognized) or knows how to save a page in a extension so that it is recognized as a redirection page ?

Thanks by advance for any idea :)

-- Gizmhail 15:58, 6 August 2008 (UTC)

Table of external redirects
For ease of maintenance of external links, I would like to create a table / list / page of external URLs and then be able to refer to these web sites by local name. This could possibly be done with a complex template. Anything simpler that could be organised? Something similar to interwiki maps?

--Ironfrown 11:45, 14 September 2008 (UTC)


 * An interwiki link works fine for this. So does a simple template. —Emufarmers(T 21:03, 14 September 2008 (UTC)

Redirecting to a version (especially a flagged, reviewed revision) of a page
I believe versions cannot be addressed in wiki syntax (only through URLs, which makes internal pages equivalent to external links). Thus a redirect to a specific version is most likely not possible. Can the normal wiki page link syntax be somehow extended to deal with versions? Where would be a good place to discuss this? --G.Hagedorn 10:04, 3 June 2009 (UTC)

Redirect from File namespace problem
I am trying to redirect from a file namespace - on many mediawiki installations this is possible, but on the current one, I am running into blocks that I can't figure out, can someone direct me? Best, MarkDilley


 * Upgrade MediaWiki. —Emufarmers(T 17:21, 23 November 2009 (UTC)

Listing all redirects in a wiki
Hi to all! Does somebody know a way to show/list all redirects that exist in a wiki? I know there is the special page Special:ListRedirects, but it is limited to 1000 pages. If it is not possible, is there a way to find them (maybe via the logfile) by using the pywikipedia bot? Thanks a lot! --Plasmarelais 16:07, 30 May 2010 (UTC)
 * This is also discussed here wikipedia:Wikipedia_talk:Special:ListRedirects. --John Ericson 23:20, 8 April 2011 (UTC)

Redirect Template
Is it possible to construct a template, that redirects to another page when the template is the only content of the supposed redirect page? For example I edit the page Stefani Germanotta so it only contains the text " ". The template is supposed to create the redirect to XXX itself without having to put it there manually (while also doing other things like inserting categories, but that I already managed to do). Note: This only an example, I'd like to have this for my Wiki not for Wikipedia. Any help is appreciated. --Theaitetos 22:09, 16 December 2010 (UTC)

Redirecting with Variables
I'm trying to redirect to a page titled June_2011_Blah (whether or not it exists). I create a page called Current_Month, link to it and put this as the redirect: #redirect August_2024_Blah but that leaves only the list item that needs to be clicked on. The plan is to have this link always pointing to this month's entry and to change automagically switch to the next month when we roll over to July, etc... Any thoughts?