ℹ️ Many blog posts do not include full scripts. If you require a complete version, please use the Support section in the menu.
Disclaimer: I do not accept responsibility for any issues arising from scripts being run without adequate understanding. It is the user's responsibility to review and assess any code before execution. More information

Adding a Website to Cloudflare Bulk Redirects - Walkthrough

Prerequisites

Before starting, I need to verify that the URL currently fails. This confirms the redirect isn't already configured elsewhere.

curl -URI https://landing.pokebearswithsticks.com

This should return a connection error or 404, confirming the URL needs configuration as below:


Step 1: Create the Bulk Redirect Rule

I navigate to the Cloudflare dashboard and access the Bulk Redirects section under Rules > Settings > Bulk Redirects as below:

Click "Create Bulk Redirect List" if this is the first redirect, or "Add" to an existing list, however is this example I already have a list so I will be editing that list I have already, the redirect lists will be below the bulk redirect rules - I need to click on the one I have already:


Then you need the option to Add url's from here choose the manual option:


That will the give you the option to add a redirect URL:


I will enter the redirect details:

  • Source URL: landing.pokebearswithsticks.com
  • Target URL: https://bloguk.z13.web.core.windows.net/
  • Status Code: 301 (permanent)
  • Preserve query string: Enable to pass URL parameters
  • Save the redirect entry.

This will then show you the re-direct in the list of re-directs as below, we need to save and exit at this point:


Step 2: Enable the Bulk Redirect Rule

After adding the redirect, I must enable the Bulk Redirect rule itself. This is often overlooked but critical.

In the Bulk Redirects overview, I locate my redirect list and ensure the toggle switch is set to "Enabled". Without this, the redirects won't function despite being configured.

I already have this rule and I can confirm it is enabled as below, as I have 3 redirects now not 2:

Step 3: Test the Redirect (It Will Still Fail)

I test the URL again:

curl -URI https://landing.pokebearswithsticks.com

At this point, the redirect still fails. This is expected because Cloudflare can only redirect traffic it receives - the domain's DNS must point to Cloudflare first.

Step 4: Configure DNS Records

I navigate to DNS management in the Cloudflare dashboard and add the necessary records:

  • Type: A
  • Name: landing
  • IPv4 address: 192.0.2.1 (Cloudflare's dummy IP for redirect-only domains)
  • Proxy status: Proxied (orange cloud ON)

The proxy status MUST be enabled (orange cloud) for Bulk Redirects to function. DNS-only records (grey cloud) bypass Cloudflare's edge and won't trigger redirects.


Step 5: Verify the Redirect Works

After DNS propagation (usually within minutes for new records), I test again:

curl -Uri https://landing.pokebearswithsitcks.com

This should now return:

HTTP/2 301
location: https://landing.pokebearswithsitcks.com

This is confirmed below as you can see I get a HTTP 200 as this resource now resolves in DNS to the redirect rule:

Common Issues and Solutions

Redirect not working after DNS configuration:

  • Verify the DNS record shows the orange cloud (proxied)
  • Check that the Bulk Redirect rule is enabled
  • Confirm the source URL in the redirect matches exactly (including www vs non-www)

SSL/TLS errors:

  • Cloudflare automatically provisions Universal SSL certificates
  • If seeing SSL errors immediately after setup, wait 15-20 minutes for certificate provisioning

Redirect loops:

  • Ensure the target URL doesn't redirect back to the source
  • Check for conflicting Page Rules that might interfere
Previous Post Next Post

نموذج الاتصال