Mass redirect

Dear CF community,

I moved my forum to a sub directory named forums. What I want now is to know is there a way to mass redirect old forum links scattered over internet to new location using rules

example:
I want to redirect pediatricsurgery.club/forum/pediatric-surgery-discussions-ac/urology/4938-laparoscopic-salvage-of-pd-catheter

to pediatricsurgery.club/forums/forum/pediatric-surgery-discussions-ac/urology/4938-laparoscopic-salvage-of-pd-catheter

If you just want to insert forums to the front of the path, a Redirect Rule makes this very easy:

Match hostname and beginning of path:
(http.host eq "pediatricsurgery.club" and starts_with(http.request.uri.path, "/forum/"))

(Edited the above to add the trailing slash for “forum” to prevent the redirect loop.

Dynamic redirect to insert forums in front of path, and preserve query string:

concat("https://pediatricsurgery.club/forums", http.request.uri.path)

2 Likes

thank you for your reply,
but the issue now links redirect to something like pediatricsurgery.club/forums/forums/forums/forums/forums/forums/forums/forums/forums/forums/forums/forums/forums/forums/forums/forums/forums/forums/forums/

and browser shows ERR_TOO_MANY_REDIRECTS

I found solution and it works!
thank you for your help

1 Like

Works from my end too.

Sorry for the redirect loop caused by that rule. I should have had it check for /forums/.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.