[ Web Proxy ]
URL:
Viewing: https://developers.cloudflare.com/rules/url-forwarding/examples/redirect-all-country/ [Back]  [Original]

Redirect requests from one country to a domain Cloudflare Rules docsSkip to content
SearchCtrlKLog in
  1. Home
  2. /Rules
  3. /
  4. /Examples
  5. /Redirect requests from one country to a domain

Redirect requests from one country to a domain

Create a redirect rule to redirect all website visitors from the United Kingdom to a different domain, maintaining the current functionality in the same paths.

Last updated May 5, 2026Copy as MarkdownView as MarkdownAgent setup

In this example, all website visitors from the United Kingdom will be redirected to a different domain, but maintaining current functionality in the same paths.

  1. Create a Bulk Redirect List named uk_redirect_list with the following URL redirect:

    • Source URL: https://example.com/
    • Target URL: https://example.co.uk/
    • Subpath matching: Enabled
    • Preserve query string: Enabled
  2. Create a Bulk Redirect Rule that enables the previous Bulk Redirect List and set the rule expression to the following:

    ip.src.country == "GB" and http.request.full_uri in $uk_redirect_list

This configuration will perform the following redirects for UK visitors:

Request URL URL after redirect
https://example.com/ https://example.co.uk/
https://example.com/my/path/to/page.htm https://example.co.uk/my/path/to/page.htm
https://example.com/search?q=term https://example.co.uk/search?q=term
PreviousRedirect requests for a domain to a new domainNextRedirect requests from one domain to another

Was this helpful?

YesNo
Edit pageReport issue
[]

Web Proxy Viewer  |  New URL  |  Original Page