How do you write this redirect?

I’d like to redirect from /review/ to /tag/review/

but if I type the following line into the redirect file I get a recursive loop. Is there a workaround?

/review: /tag/review/

Does it work with this?

  ^/review$: /tag/review
1 Like

Thanks for this. I still get the same infinite loop.

I think you want a / on the end of Vikas’ match - I think the / gets added before redirects get parsed?
^/review/$: /tag/review

But hang on … if you weren’t matching, you wouldn’t get an infinite loop. See below!

Your site is current redirect looping to /tag/tag/tag/……/review, but I don’t know which version of all this you have loaded! The ^ means start of line, so I’m puzzled!

1 Like

Another possibility - you fixed it, but you’re hitting a cache for that 301 redirect. Try your phone or another device!

You might also want to check your routes.yaml…

1 Like

This version:

^/review/$: /tag/review

fixed it. Thanks.

I haven’t touched routes.yaml yet and hope to keep things that way ;)

1 Like