Redirects parse order and 404s #217
mark-adigital
started this conversation in
Feature Requests
Replies: 1 comment
|
We have this same issue on Craft CMS 4.4.8 and Sprout Redirects 4.44.445 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hey - we're running Sprout SEO 4.6.9 on a site and have had a couple of issues. Firstly, there was a scenario where we had added a Regular Expression match redirect and the client then added an exact match one, but because the regular expression one is parsed first, the exact match redirect was never honoured.
The regular expression redirects
plants/(.*)toindoor-plants/$1and the exact match redirects fromplants/elephant-ear-zebrinatoindoor-plants/alocasia-zebrinaWe resolved this by making sure the regular expression redirects were positioned after the exact match one, but I wonder if it might be better to prioritise exact match redirects before regular expression ones rather than the order of redirects in Craft?
The other issue we've seen is where a redirect leads to a 404, so an example is: https://thestem.co.uk/plants/stone-pine
This leads to: https://thestem.co.uk/indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-indoor-plants/stone-pine
And a 403 forbidden error. This is actually also what was happening before re-ordering the redirects to have the regular expression ones at the end. It seems like due to the redirected URL also throwing a 404, the redirect is kicking in recursively, hence all the
indoor-segments.If you could look into this and find a solution so that a redirected URL can still throw a 404, that would be great.
All reactions