[wp-meta] [Making WordPress.org] #6407: Add 301 redirect information to manifest
Making WordPress.org
noreply at wordpress.org
Fri Jul 15 12:07:08 UTC 2022
#6407: Add 301 redirect information to manifest
-----------------------------+--------------------------------------
Reporter: bph | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Developer Hub | Keywords: dev-feedback needs-patch
-----------------------------+--------------------------------------
When updating a page for the block editor handbook, once in a while, the
page's slug or URL
Examples:
* Single page's slug changes:
''block-filters'' to ''block-hooks''
* Single page's parent folder changes
''**old:** reference-guides/filters/block-filters''
''**new:** reference-guides/hooks/block-hooks''
* Two pages are combined into a third.
''**old:** reference-guides/filters/block-filters
** old:** reference-guides/filters/block-actions
**new:** reference-guides/hooks/block-hooks''
In all this cases, the import process would need to accommodate also 301
redirects from the old pages to the new pages, so links to the old pages
won't go dead.
Currently, the manifest page object reads:
{{{
{
"title": "Block Filters",
"title": "Block Hooks",
"slug": "block-filters",
"markdown_source": "../docs/reference-guides/filters/block-filters.md",
"parent": "filters",
},
}}}
For the updated pages the manifest would look like this, with a possible
new field "redirect_from"
{{{
{
"title": "Block Filters",
"title": "Block Hooks",
"slug": "block-hooks",
"markdown_source": "../docs/reference-guides/hooks/block-hooks.md",
"parent": "hooks",
"redirect_from":["reference-guides/filters/block-filters"]
},
}}}
Note: {{{redirect_from}}} is an array, in case it needs more than one
value, to cover the third examples, when there needs a redirect from two
old pages to a single new page.
Then it would look something like this:
{{{"redirect_from":["reference-guides/filters/block-filters", "reference-
guides/filters/block-actions"]}}}
With this information, the import script could create the 301 redirect
strings on when importing the new docs.
Maybe new location string should have a "../docs/" for accuracy?
I am not familiar where and how the magic works on server level for for
the block editor handbook. So, there are still a few blind spots that need
to be filled.
--
Ticket URL: <https://meta.trac.wordpress.org/ticket/6407>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org
More information about the wp-meta
mailing list