How to Create Wildcard Redirect in Cloudflare

Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated
Create a realtime database firebase

You might need to move your website every once in a while. This could be due to a redesign, rebranding, marketing landing page A/B testing, domain change, and traffic redirection to updated content.

In this article, we will cover the steps necessary to Create a Wildcard Redirect in Cloudflare. Creating a Wildcard Redirect will not require much knowledge. What you need to understand is to implement the rules correctly in your Cloudflare Account.

What is Wildcard Redirect?

Wildcard redirect is very helpful when you want to change the names of URLs in a directory or send users from any URL in a directory to another place.

With the help of wildcard redirect, you can redirect users from i.e "" to "".

You can also use it to redirect users who are typing random urls on your website to your homepage or any other URL. i.e "" to "". Let's begin!

How to Set up Wildcard Redirect Rules?

Step 1: Log in to your Cloudflare Account and choose your domain.

Step 2: Go to Rules.

Step 3: Click Create Page Rule under Page Rules tab.

Step 4: The Create Page Rule for your_domain dialog opens.

Step 5: Under If the URL matches, enter the URL or URL pattern that should match the rule. i.e*

Enter the URL Directory from where you want to redirect users from. Add an asterisk (*) character, at the end of the url, this is the wildcard symbol.

Step 6: Under Then the settings are, click Add a Setting.

Step 7: Select an option from the dropdown menu. For this tutorial we select Forwording URL.

You can include more than one setting per rule.

Step 8: Next click Select status code, then select an option from the menu according to you need.

Step 9: Go to Enter destination URL directory, where you want the users to get redirected. i.e$1

Add an $1 symbol at the end of the url.


Step 10: From the Order dropdown, specify the desired order: First, Last, or Custom, i.e select First

Step 11: Choose a Save option:

Page Rule will now redirect every url from "" directory to "" directory. The $1 will be replaced with the url you entered after the "" directory. So the url will be same and only the directory will change.

  • Save as Draft to save the rule and leave it disabled. Note that disabled rules count towards the number of rules allowed for your domain.
  • Save and Deploy to save the rule and enable it immediately.

Cloudflare Page Rules do not support non-ASCII characters (for example, punycode/unicode domain). As a workaround, you can URL-encode the string using the Punycode converter.

How to Edit existing page rules?

Editing the wildcard redirect page rule in Cloudflare is not a rocket science.

Step 1: Log in to your Cloudflare Account and select your Domain.

Step 2: Select the domain where you want to edit your page rule.Click Rules.

Step 3: In the Page Rules tab, locate the rule to edit.

Step 4: Proceed to make the necessary changes, as follows:

  • To enable or disable a rule, click the On/Off toggle.
  • To modify the URL pattern, settings, or order, click the Edit button (wrench icon). In the dialog, enter the information you want to change.

How to Delete a Cloudflare Page Rule?

Step 1: Log in to your Cloudflare Account and select your Domain. Select the domain where you want to edit your page rule.

Step 2: Click Rules.

Step 3: In the Page Rules tab, locate the rule to edit.

Step 4: Click the Delete button (wrench icon) and confirm the deletion when prompted.

Final Words

Leave a comment below if you have any questions about the Cloudflare Wildcard Redirect, tutorial.

If you think this article was helpful, please share it with your friends and other people. I'm grateful.

Make sure to bookmark our website by pressing CTRL+D, as I will be sharing more amazing posts and codes similar to this one in future entries.

About the Author

Ordinary People

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.