Sometimes (docs) pages get removed, renamed, and added. There is a redirects file that contains redirects for such occasions. It has three sections:
general
: single-page redirects,docs-global
: redirects across all docs versions and languages, anddocs
: version-specific docs redirects.For non-docs URIs, there are no versioning considerations. Make redirects like so:
general:
- "old/uri/for/page.html": "its/new/uri.html"
NOTE: Review (and test, if possible) these redirects before making them live, since they're permanent (HTTP 301) redirects. Incorrect permanent redirects will make a URI almost impossible to bring back into browsers and search indices.
There are five cases of changing URIs:
Do nothing. Going back in time for new docs is unsupported.
If the URI is removed, mark it as deprecated in latest/
like so:
docs:
- "latest/old/uri/for/page.html": "deprecated.html"
If the URI is moved, point it to its new location in latest/
like so:
docs:
- "latest/old/uri/for/page.html": "latest/its/new/uri.html"
These will handle the case where the "this content is outdated" link is clicked. The case where a user jumps to a specific version is not yet supported.
Add the redirect (in the docs-global
section this time) like so:
docs-global:
- "old/uri/for/page.html": "its/new/uri.html"
Do nothing. It is now an un-URI. It never existed.