Take all possible redirects into account
The logic of finding if a page should redirect needed changing.
We were missing the edge case where the redirect_to
URL wasn't a relative URL and didn't end in .html
.
With the new rules:
- If a document has the
redirect_url
set to:- a relative
.md
URL, replace.md
with.html
and use that URL to redirect. - a relative
.html
URL, use that URL and redirect. - an external
.md
URL, replace.md
with.html
and use that URL to redirect. - an external
.html
URL, use that URL and redirect. - an external clean URL, use that URL and redirect.
- a relative
- Similarly, if there isn't a
redirect_to
, theThis document was moved to [here](link)
notation is taken into account withlink
behaving the same as the value ofredirect_url
.
Test with:
Edited by Achilleas Pipinellis