Can i block specific pages to country access?

Is it possible to block specific url on my website to area or country?
I mean not blocking wholes website but specific url on the website from specific country access .
please help

Greetings,

Thank you for asking.

Sure, it is possible if your domain name is using Cloudflare, you can achieve this by using Firewall Rules.

For example, block any request (or user) from Croatia to access the URL https://www.mydomain.com/example-url/ (allow everyone except users from Croatia to access it):

  1. Navigate to the Firewall → Firewall Rules
  2. Click on the blue button “Create a Firewall Rule”
  3. Select URI Full then “equals” and enter your URL address
  4. Click on the button “AND”
  5. Select Country → if only one country, then “equals”, else if more than one use “is in” and select/enter the country
  6. Choose an action → select “Block”
  7. Click on the blue button “Deploy”
  8. Wait for a minute or two to apply the changes

In picture, should look like below example:

thank you
if i need few urls blocked to the same coiuntry , should i add more URI Full with "or " and then at the end of all the urls arr the country with “AND”
will that work ?

If the URL is the same, but you want to restrict few countries, you select “is in” then type countries in the field.

  1. URL and Country is in A, B, C, D, E, F …
    OR
  2. the other URL and Country is in A,B,C,D,E,F …

If the URL is different, then as below …

From my screenshot above, you click OR, then repeat the same:

  1. 1st URL Full - your URL and equals CountryB (else you can use Country “is in” then enter multiple contries CountryA, CountryB, CountryC)
  2. 2nd URL Full - your URL and Country equals CountryB (else you can use Country “is in” then enter multiple contries CountryA, CountryB, CountryC)
  3. 1st URL Full - your URL and equals CountryB (else you can use Country “is in” then enter multiple contries CountryA, CountryB, CountryC)

Then for next one, again OR.

You have to group each URL and country then use OR.

URL Full AND Country ABC
OR
URL Full AND Country DEF
OR
URL Full AND Country GHI

See my examples here - I added each country to each URL:

ž

In second example here - I grouped few countries for each URL:

You can share a screenshot of your firewall rule when you believe you’ve done ir correct in a reply so we can check and provide feedback to you.

thank you
I undestand

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