Fix loop redirections #17822
Description
When a generic regex is used, and the target is wrong, a loop is created in the redirection. With this enhancement, the same regex will be blocked when it tries to redirect more than 3 times.
Checklist
- I fully tested it as developer / designer and created unit / integration tests
- I documented it (or no need to document or I will create a separate documentation issue)
- I worked with the design team to get their idea for UI/UX design (or no need to design for this PR)
- I've assigned reviewer, related labels and set a milestone for this PR