How to Setup Wildcard 301 Free URL Forwarding With Cloudflare

As some of you may know, this woorkup blog used to be under the wpseer branding until I migrated it over. I acquired wpseer a while back and made the shift to a new name because this is not just a WordPress site, but targeted to many other types of marketers. One issue I ran into was that while I had up, I had migrated it to HTTPS. So when I went move to woorkup branding, I had backlinks on both the HTTP and HTTPS versions. The problem was, I didn’t want to keep that WordPress site up and running just for the 301 redirects. And that is where Cloudflare came to the rescue with free URL forwarding.

Follow the tutorial below on how setup free URL forwarding with Cloudflare, along with 301 wildcard redirects.

Free URL Forwarding With Cloudflare

A while back I wrote a post about how to implement wildcard 301 URL forwarding with your domain registrar. However, the problem with that is, you can only do the HTTP version because doing URL forwarding from HTTPS requires having an SSL certificate installed. The great news is, you can do this with Cloudflare, even if there is no hosting connected it. And what do I mean by a wildcard redirect? It means for example that any traffic that tries to access redirects to So in this instance, the following 301 redirects work:

  • 301 redirects to
  • 301 redirects to
  •* 301 redirects to*
  •* 301 redirects to*

This ensures that all the backlinks on both the HTTP and HTTPS versions don’t break for SEO purposes. Remember, 301 redirects are needed to pass link juice. And this of course assumes that your URL structure remains the same on the new domain.

Step 1

First you will need to add your domain that you want to redirect to Cloudflare. Simply signup for a free account and click on “+ Add Site.” Input your domain and click on “Begin Scan.” It may take a minute or two and then click on “Continue Setup.”

add site cloudflare
Add site to Cloudflare

Step 2

By default the scan will show you the records of your current domain. You can simply delete everything and simply leave an A name record for both the www version and your primary domain. The IP address is simply the one provided by your current domain registrar. In this case, it was just NameCheap. Then click on “Continue.”

cloudflare dns records
Cloudflare DNS records

Step 3

Select the Cloudflare free plan and click “Continue.”

cloudflare free
Cloudflare free

Step 4

You will then need to point your current domain to the Cloudflare nameservers. You can do this at your domain registrar.

cloudflare change nameservers
Cloudflare change nameservers

Step 5

Under the Crypto menu, select “Flexible” SSL. You will need this to ensure that redirects over HTTPS also work.

cloudflare flexible ssl
Cloudflare flexible SSL

This enables a universal SSL certificate on both * and This uses SNI and works on the following browsers:

Desktop Browsers installed on Windows Vista or OS X 10.6 or later:

  • Internet Explorer 7
  • Firefox 2
  • Opera 8 (with TLS 1.1 enabled)
  • Google Chrome v5.0.342.0
  • Safari 2.1

Mobile Browsers

  • Mobile Safari for iOS 4.0
  • Android 3.0 (Honeycomb) and later
  • Windows Phone 7

Step 6

Under the Page Rules menu click on “Create Page Rule.”

cloudflare create page rule
Cloudflare create page rule

Step 7

You will then want to enter the following pattern:*

Select “Forwarding URL” and “301 – Permanent Redirect” for the settings, and input the following rule:$1

The /$1 enables the wildcard part to function. Then click on “Save and Deploy.”

301 redirect wildcard with Cloudflare
301 redirect wildcard with Cloudflare

The single rule above makes the following work:

  • 301 redirects to
  • 301 redirects to
  •* 301 redirects to*
  •* 301 redirects to*

Read more about Cloudflare page rules. And that is it! You can now ditch the hosting plan on your old domain and your wildcard 301 redirects will now be in place forever, pointing to your new domain. You can easily test different variations with Redirect Tracker.

301 redirect cloudflare tracker
Redirect tracker

Hopefully, this tutorial on free URL forwarding will help you on your next migration!

Get More Stuff Like This

Marketing, WordPress, Blogging Tips, SEO and Reviews, twice a month.

Thank you for subscribing.

Something went wrong.

Brian Jackson

Co-founder at forgemedia. Blogger and entrepreneur obsessed with SEO, marketing, and web performance. Connect on Twitter @brianleejackson.

9 thoughts on “How to Setup Wildcard 301 Free URL Forwarding With Cloudflare”

  1. Thankyou. But I think redirect check only work in httpstatus io. I have check at redirect-checker org doesnt work. Can you explain that? Thanks

    • Hey Adjie,
      I would have to see it, so I’m not sure. However, I replaced HTTP Status tool above with Redirect Tracker. No ads :)

  2. just wanted to tell you thank you,

    i just did a 301 and yeah i was facing the same problem. cloudflare was redirecting all the domains to home page but with $1 it redirected to the relevant pages.


Leave a Comment