Manual:Redirect table

The redirect table contains for each page that is currently a 1>m:Special:MyLanguage/Help:Redirect|redirect (i.e., not for old revisions which are redirects) the id of the source page and the information about target.

The target page may or may not exist.

Fields
A target is broken into four parts: interwiki prefix (should be empty for a regular redirect), namespace, title and fragment.

rd_from
Contains the  of the source page.

rd_namespace
Contains the number of the target's .

rd_title
Contains the sanitized title of the target page.

It is stored as text, with spaces replaced by underscores.

rd_fragment
Contains 1>m:Special:MyLanguage/Help:Section#Section_linking_and_redirects|the target's fragment ID if present (see also 218), otherwise is NULL.

rd_interwiki
This field is not empty only if an is used: #REDIRECT &#91;[prefix:…]] (a prefix such as "w:" for Wikipedia, or an 4>m:Special:MyLanguage/Help:Interwiki_linking#Interlanguage_links|interlanguage link prefix such as "nl:" for Dutch, but not both).

In this case a redirect is not visible in Special:WhatLinksHere</> (even if the target lies in the same wiki), <tvar|2><tt>rd_namespace</tt></> is always 0 and <tvar|3><tt>rd_title</tt></> may contain a possible namespace prefix, but <tvar|4><tt>rd_fragment</tt></> may be non-NULL.

Schema summary
+--+--+--+-+-+---+ +--+--+--+-+-+---+ +--+--+--+-+-+---+
 * Field       | Type             | Null | Key | Default | Extra |
 * rd_from     | int(10) unsigned | NO   | PRI | 0       |       |
 * rd_namespace | int(11)         | NO   | MUL | 0       |       |
 * rd_title    | varbinary(255)   | NO   |     |         |       |
 * rd_interwiki | varbinary(32)   | YES  |     | NULL    |       |
 * rd_fragment | varbinary(255)   | YES  |     | NULL    |       |

+--+-+--+-+-+---+ +--+-+--+-+-+---+ +--+-+--+-+-+---+
 * Field       | Type                | Null | Key | Default | Extra |
 * rd_from     | int(10) unsigned    | NO   | PRI | 0       |       |
 * rd_namespace | int(11)            | NO   | MUL | 0       |       |
 * rd_title    | varchar(255) binary | NO   |     | NULL    |       |

+--+-+--+-+-+---+ +--+-+--+-+-+---+ +--+-+--+-+-+---+
 * Field       | Type                | Null | Key | Default | Extra |
 * rd_from     | int(8) unsigned     | NO   | PRI | 0       |       |
 * rd_namespace | int(11)            | NO   | MUL | 0       |       |
 * rd_title    | varchar(255) binary | NO   |     | NULL    |       |