Page / Country Redirect Possible With Cloudflare?

Hi there Cloudflare Community.

I have been sniffing around for some documentation if regards to my question, however, unable to source a solution. Sorry for the question.

Using Cloudflare, is it possible if a website user from a specific country lands on a specific page on my website, can I use Cloudflare to automatically redirect them to a specified URL?

1 Like

Yup, you can.

This is a great use-case for Redirect Rules. They allow you to match on certain conditions (in your case, the pathname and country) and perform a redirect if those conditions match.

Go to https://dash.cloudflare.com/?to=/:account/:zone/rules/redirect-rules to configure threm.

You’ll need to use the URI Path matcher (to match a path on your site), then hit the AND button and choose a Country matcher to match the country you want.

Example is below. Make sure the status code is 302 (not 301 which indicates a permanent redirect) and replace the URI Path/Country/URL redirect with your own values.

1 Like

Awsome!

Great thanks ill give this a try and get back to you,

Cheers

1 Like

Hi there

Well it looks like that worked! Thanks so much

Now I can redirect traffic from two certain regions who constantly land on my contact us & information page for the single purpose of sending me those super annoying emails

“Want to buy guest post” 'Check out my sites" “How much for to buy casino links from you”

Now these pages redirect to a “Buzz Off Page”

Thanks Heaps!!!

1 Like

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