Redirect Rules: uk.example.com/whatever/comes/next to fr.example.com/whatever/comes/next

I want redirect urls like;
uk.example.com/whatever/comes/next to
fr.example.com/whatever/comes/next if the user’s IP in France.

Example. if a user in UK send the link uk.example.com/whatever/comes/next to a user in France,
then, the user in France is redirected to fr.example.com/whatever/comes/next.

Currently, I managed to redirect
example.com/whatever/comes/next and
www.example.com/whatever/comes/next to
fr.example.com if the user is in France
(and it should be fr.example.com/whatever/comes/next instead.)

here is the Expression Builder I used:

Am I missing something?

Update
Now I fixed the path by using this:

concat(“https://”, “fr”, “.example.com”, http.request.uri.path)

Update2
Fixed the issue with these shorter rules:

Thanks @cbrandt .

Although you have both “eu” and “sn” in your examples, I think you meant to use “fr”, right?

Also, you do not need to concatenate 3 sequential string elements, you could join them:

concat("https://fr.example.com",http.request.uri.path)

Yes, I just edit it.

1 Like

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