Hey community,
I don’t want to show my entire site to specific countries. How can I set this up in Cloudflare?
Thanks,
Timo
Hey community,
I don’t want to show my entire site to specific countries. How can I set this up in Cloudflare?
Thanks,
Timo
You can use firewall rules to block traffic based on its country of origin.
https://developers.cloudflare.com/firewall/
Example that would block US & UK traffic to part of a website:
That’s awesome! Thanks!
Can I show one specific page to visitors also? I mean if people from Germany see any of my pages, show a specific page with a message?
Thanks,
Timo
Also, what do I need to set, if I want to block the whole domain? So, that none of the sites with that domain can be seen?
The firewall rule, minus the URI Path check will block unwanted countries from accessing anything in that zone (domain). The URI path really isn’t necessary in the situation you described.
Not from that domain, as it’s completely blocked. I can only think of a pretty convoluted approach:
Just to be sure. I can set it this way?
Send people from country X who visit any page of domain A to a specific page on domain B?
That’s doable with what you suggest above?
Thanks,
Timo
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
Hey! I was asking this before, but my threat is already closed…
I was asking how I can block specific countries. I learned that I can do this in the firewall settings.
User “sdayman” told me that I can use the “transformation rule” to redirect people from the countries I want to block and have a message there for them, by leading them to a different domain, but I can’t find this setting anywhere in that list of rules…
Thanks,
Timo
Hi Timo… I think I have seen you somewhere already Don’t know where… any chances you are german?
@sdayman is correct. I can recommend the tutorial from @michael: Redirect from a page to anotherpage for specific country for free - #4 by michael
Have a look at it and report back.
Additionally to that, there are also other options:
Now I know, it was the good old Digitale Eliteboard
Hey Martin, (I guess)
yes I am German and I am a member there - so chances are that we met there once
Thanks for the info. I’ll take a closer look tomorrow.
Tschüss,
Timo
Hey again!
I created the rule now, and I redirect to a different page, but I still can see that page. Any idea why?
Thanks,
Timo
Probably because the redirect does not work or the rule does not match the URL you are testing against.
If you could provide us with the URL and the PageRule/TransformRule we can look into that.
Ok. Here’s my setup:
Thanks
Please change the marked area:
to:
sorry-content-is-not-available/
(without the leading https://timodee.com/
)
And please first turn on the proxy in your DNS section on your entry for
timodee.com
since it currently is on . Otherwise you can not use Cloudflare features on this DNS entry.
ok. Thanks,
If I change that, how will cloudflare know that it should redirect to timodee.com? I’m blocking countries for a different domain…
Also, what is the difference between those two DNS settings? Will everything work as usual after the change?
Just to clarify: I’m blocking countries for all sites of “domainA” and I want to redirect to one specific site of “domainB”. Both domains are managed with cloudflare…
Then you:
For basic understanding on what a proxy does and what the status does mean I would recommend the docs.
Then please do it like this:
sorry-content-is-not-available/
domainA.tld/sorry-content-is-not-available/
to https://domainB.tld
nothing to do here since you redirect to this domain, not from this domain.
And this also works if I block the whole domainA?