Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Numinix MediaWiki Demo
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
API/Query
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Resolving redirects == <!--T:77--> </translate> <translate><!--T:78--> Redirects can be resolved automatically, so that the target of a redirect is returned instead of the given title.</translate> <translate><!--T:79--> When present, they will always contain <tvar name=1><code>from</code></tvar> and <tvar name=2><code>to</code></tvar> attributes and may contain a <tvar name=3><code>tofragment</code></tvar> attribute for those redirects that point to specific sections.</translate> <translate><!--T:80--> Both normalization and redirection may take place.</translate> <translate><!--T:81--> In the case of multiple redirects, all redirects will be resolved, and in case of a circular redirect, there might not be a page in the 'pages' section (see [[<tvar name=1>#circular_redirects</tvar>|an example request]]).</translate> <translate><!--T:82--> Redirect resolution cannot be used in combination with the <tvar name=1><code>revids=</code></tvar> parameter or with a generator generating revids; doing that will produce a [[<tvar name=2>#Possible warnings</tvar>|warning]] and will not resolve redirects for the specified revids.</translate> <translate> <!--T:83--> The examples below show how the <tvar name=1><code>redirects</code></tvar> parameter works. </translate> {{ApiEx | desc=<translate><!--T:84--> Using "<tvar name=1>redirects</tvar>" parameter.</translate> <translate><!--T:85--> "<tvar name=1>Main page</tvar>" is a redirect to "<tvar name=2>Main Page</tvar>"</translate> | p1=action=query | p2=titles=Main%20page | p3=redirects | p4=format=json | p5=formatversion=2 | result=<syntaxhighlight lang="json"> { "batchcomplete": true, "query": { "redirects": [ { "from": "Main page", "to": "Main Page" } ], "pages": [ { "pageid": 15580374, "ns": 0, "title": "Main Page" } ] } } </syntaxhighlight> }} {{ApiEx | desc=<translate><!--T:86--> Same request but without the "<tvar name=1>redirects</tvar>" parameter.</translate> | p1=action=query | p2=titles=Main%20page | p3=format=json | p4=formatversion=2 | result=<syntaxhighlight lang="json"> { "batchcomplete": true, "query": { "pages": [ { "pageid": 217225, "ns": 0, "title": "Main page" } ] } } </syntaxhighlight> }} {{ApiEx | desc=<translate><!--T:87--> Without "<tvar name=1>redirects</tvar>" you may want to use <tvar name=2>prop=info</tvar> to obtain redirect status.</translate> | p1=action=query | p2=titles=Main%20page | p3=prop=info | p4=formatversion=2 | result=<syntaxhighlight lang="json"> { "batchcomplete": true, "query": { "pages": [ { "pageid": 217225, "ns": 0, "title": "Main page", "contentmodel": "wikitext", "pagelanguage": "en", "pagelanguagehtmlcode": "en", "pagelanguagedir": "ltr", "touched": "2017-12-17T02:02:05Z", "lastrevid": 777924062, "length": 170, "redirect": true } ] } } </syntaxhighlight> }} {{ApiEx | desc=<translate><!--T:88--> Request with a section link.</translate> <translate><!--T:89--> "<tvar name=1>Wikipedia:!--</tvar>" is a redirect to "<tvar name=2>Wikipedia:Manual of Style#Invisible comments</tvar>"</translate> | p1=action=query | p2=titles=Wikipedia:!-- | p3=redirects | p4=format=json | p5=formatversion=2 | result=<syntaxhighlight lang="json"> { "batchcomplete": true, "query": { "redirects": [ { "from": "Wikipedia:!--", "to": "Wikipedia:Manual of Style", "tofragment": "Invisible comments" } ], "pages": [ { "pageid": 33697, "ns": 4, "title": "Wikipedia:Manual of Style" } ] } } </syntaxhighlight> }} <translate><!--T:90--> Here is a case of a circular redirect: <tvar name=1>Page1 → Page2 → Page3 → Page1</tvar>.</translate> <translate><!--T:91--> Also, in this example a non-normalized name <tvar name=1>'page1'</tvar> is used.</translate> |p1=action=query |p2=titles=page1 |p3=redirects |p4=format=json |p5=formatversion=2 |result=<syntaxhighlight lang="json"> { "batchcomplete": true, "query": { "normalized": [ { "fromencoded": false, "from": "page1", "to": "Page1" } ], "redirects": [ { "from": "Page1", "to": "Page2" }, { "from": "Page2", "to": "Page3" }, { "from": "Page3", "to": "Page1" } ], "pages": [ { "ns": 0, "title": "Page1", "missing": true } ] } } </syntaxhighlight>}} <translate>
Summary:
Please note that all contributions to Numinix MediaWiki Demo may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Project:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)