craft-retour icon indicating copy to clipboard operation
craft-retour copied to clipboard

Account for cascading 301s on an entry that has slug changed multiple times

Open codyjames opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe.

We have some posts that may have their slug changed multiple times which is creating multiple redirects.

Imagine a post that has a slug of A, then gets changed to B, then, gets changed to C, and finally to D. If Retour creates redirects for it every time the slug changes, we end up with three redirects. If anyone ever visits A they get redirected to B then C then D.

Describe the solution you would like

Is there any way to determine the final end url rather than going through all of the redirects? Ideally if someone went to A they'd get redirected straight to D.

Describe alternatives you have considered

Manually edit all of the redirects whenever this scenario would come up.

Additional context

This would help reduce crawl burden.

codyjames avatar Apr 10 '25 18:04 codyjames

Related to: https://github.com/nystudio107/craft-retour/issues/261

khalwat avatar Apr 10 '25 22:04 khalwat

This could be a little involved, only because currently there is nothing linking a redirect to an entry. So it doesn't "know" what entry it belongs to, compared to another redirect that was set up independently.

Also potentially, if a URL has been given out, you may need/want the historic redirects still in place.

khalwat avatar Apr 16 '25 23:04 khalwat

Sounds good! I'll close. :)

codyjames avatar Apr 16 '25 23:04 codyjames

I'll keep it open if that's okay. It seems like a good suggestion to consider at some point.

khalwat avatar Apr 16 '25 23:04 khalwat