Closed amadeann closed 3 years ago
Hi @amadeann
The behaviour you're describing is actually how the addon works: It only performs the redirects if Statamic would display a 404 otherwise. URLs resolved to content from Statamic are never redirected.
Redirects from this module are kept separate from Statamic's redirects configured in the
routes.yaml
file. They are only checked and possibly executed if a 404 response is created by Statamic.
Hope that helped a bit!
Cheers
I tried to create a redirect from a relative URL on my site:
/blog/cleaning-products-you-should-never-mix
to:
https://cleanchaps.com/blog/cleaning-products-you-should-never-mix
cleaning-products-you-should-never-mix
is a collection item (blog post) on my site. The route to bold posts is defined asblog: '/blog/{slug}'
inroutes.yaml
. Another redirect to the same page, i.e.:from:
/cleaning-products-you-should-never-mix
to:https://cleanchaps.com/blog/cleaning-products-you-should-never-mix
It also works when I change the slug of the glob post to something like:
/blog/cleaning-products-you-should-never-mix-modified
.When I unpublish the post the redirect works when I am logged out from Statamic.
To summarize, it looks to me like Statamic/your plugin first checks for the existence of a given collection item, and only then for a redirect.