For a long time, I used Cloudflare page rules for my most important redirects. In fact, I’d written an article on using Cloudflare to speed up websites, and page rules for redirects were one of the tips I shared. Since then, however, Cloudflare has created a whole new system for page redirects. The new configuration gives you far more redirects than was possible using page rules and lets you enable and disable groups of page rules at a time. Here’s how it works.
Example: Using Cloudflare for Affiliate Redirects
A great example of the benefits of using Cloudflare for redirects is when it comes to redirecting affiliate links. These are situations where speed is of the essence, and the last thing you want, is a potential customer getting frustrated because the redirect is taking too long.
So for this article, I’ll use affiliate links to demonstrate Cloudflare bulk redirects as I use them on my own site WP-Tweaks.com.
Step 1: Enter the Bulk Redirect Interface
To access the Bulk Redirects interface in Cloudflare, make sure you haven’t selected any particular zone. The option shows up only when you’re viewing your global Cloudflare settings and not those for any site. You should see the Bulk Redirects option on the left-hand side like this:
Once you’ve entered the interface, it’s time to create a list.
Step 2: Create a Bulk Redirects List (NOT a Rule)
The terminology can get a bit confusing, but you first need to create a “Bulk Redirects List“, and not a “Bulk Redirects Rule“. To do this, click the link as shown below:
A bulk redirects list is a collection of “source/target” pairs. Once this is done, we’ll create a “Rule” to either enable or disable this list. Give your redirect list a name, and it’s time to start adding entries.
Add Items to the List
The interface for adding items to the list is easy. There’s the source field, the target field, and the kind of redirect you want to use. For affiliate links, I use 302 redirects, but if you need, you can use 301 redirects instead. Here’s a screenshot:
Keep adding your redirects until you’re done, and then save your changes. You can see here that I’ve added a bunch of affiliate link redirects:
Bulk Redirect Limits
The number of redirects you can use depends on your Cloudflare plan. With the old page rules system, you were limited to a maximum of three page rules on the free plan. And these page rules included all the other functionalities that you can enable with page rules. With the bulk redirects system, the quotas are far more generous as shown here:
Cloudflare Plan | Bulk Redirects Quota |
---|---|
Free | 20 |
Pro | 500 |
Business | 500 |
Enterprise | 10,000 |
So already this is a huge improvement over page rules. Whereas previously, you could only have 3 redirects on the free plan, now you can have 20. The Pro plan gives you a generous 500 redirects, which is why I think the Cloudflare Pro plan is worth it.
Use Bulk Redirect Rule to Enable the List
Creating a list by itself doesn’t enable the redirects that it contains. You need to create a Bulk Redirect Rule and enable the list like this:
Save your rule, and you’re done!
Verifying that the Redirect is Working
As far as I know, Cloudflare doesn’t provide any statistics on how many redirects they process, so you’ll have to check them yourself. I use the amazing Redirect Checker tool, and you can see in the screenshot below, that my 302 redirect is working as expected:
And you’re done! Now you can add as many redirects as your plan allows, and benefit from the super fast speeds that Cloudflare enables.
I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!
Leave a Reply