For clients like mobile apps and API-driven frontends, it would be useful if RESTBase supported following [MediaWiki's #redirects](https://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Redirects). However, VisualEditor in particular also needs the continued ability to retrieve the redirect page itself, so that it can be edited to change the redirect target, or converted into a regular content page by removing the redirect.
## Option 1: Status 302 & location header, but return the HTML
When encountering an internal redirect (same wiki, possibly wikimedia project), RESTBase will respond with a 302 temporary redirect status & a location header pointing to the destination page. It will also return the HTML body & etag as with current responses. In this model, the client receives both redirect information and the body data. This means that it can choose to follow the redirect, or edit the page using the returned body.
At present, the redirect destination is only available inline as a meta tag. This means that we'd need to extract this meta tag from the HTML content, which is certainly quite hacky. In the longer term, it would be desirable for Parsoid to return information about the redirect target in accompanying page metadata (JSON blob). There is some discussion of this in {T105845}.
## See also
- https://github.com/wikimedia/restbase/pull/365: WIP redirect support based on page renames, but ignoring MediaWiki's #redirects.