- Bug fix to properly migrate older redirects missing a
targetLocale
property, and to tolerate situations where this property is irrelevant or makes reference to a locale that no longer exists in the system. - Fixes permanent redirects (301) being 302 because
statusCode
of the redirects were never fetched. - README and package description updated.
Several fixes and improvements contributed by Stéphane Maccari of Michelin:
- Add a way to modify the target url before doing the redirection
- Irrelevant SEO fields are properly removed from redirect pieces
- The
ignoreQueryString
field is honored properly - Redirects to internal pages are saved properly
- Admins adding redirects may now elect to pass on the query string as part of the redirect
before
option added, giving the option of running the middleware earlier, e.g. before@apostrophecms/global
- Performance enhancement: skip the redirect check for API URLs like
/api/v1/...
. This can be overridden using theskip
option
Many thanks for this contribution.
- Adds possibility to redirect from a locale to another one using internal redirects.
- Fixes redirections when using locale prefixes.
- Removes
apostrophe
as a peer dependency.
- Any exceptions thrown in the middleware are caught properly, avoiding a process restart.
- Adds
noMatch
event for implementing fallbacks, and also documents how to preempt this module if desired.
- Adds English (
en
) locale strings for static text. - Adds Spanish (
es
) localization to static text. Thanks to Eugenio Gonzalez for the contribution. - Adds Slovak (
sk
) locale strings for static text. Thanks to Michael Huna for the contribution.
- Localization is inappropriate for redirects since it's necessary to be able to redirect from any URL. Previously
autopublish: true
was used by the module, butlocalize: false
is more appropriate as it eliminates multiple locale versions altogether. A migration has been added to take care of existing redirects in this transition. - Fixes README code examples for the
withType
andstatusCode
options.
- Initial port from Apostrophe 2.0