Redirect from a page to anotherpage for specific country for free

Is possible to redirect the users from a specific country (Italy in my case) to another page using Cloudflare and not PHP/.htaccess for free?

Update: I stand corrected by a very clever @michael

Sorry, but no. You’d have to use Workers, and that’s $5/month. I believe the free Workers plan does not allow custom domains.

I have solved with a PHP script

This can actually be done using a combination of Transform Rules and Page Rules.

Transform Rules let you target various different parameters, including Country. So you can create a Transform Rule that only triggers if the user request came from the country you want to redirect. In the action of the Transform Rule, make a modification to the URL that you can later on match in a Page Rule.

Then create a Page Rule that matches against the altered URL, and perform the Page forwarding.

4 Likes

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