Page rule forwarding with subdomain and wildcards

Hello folks

I have a question / challenge for you out there:

I am looking for a solution using page rules (if needed also CNAME records) to achieve following 301 - Permanent Redirects:

* "" --> ""
* "" --> ""
* "" --> ""
* "" --> ""

In other words, I want to drop the “www” part for all possible scenarios.

I did have part success with the rule:

https://www.* Forwarding URL (Status Code: 301 - Permanent Redirect, Url:$1)

But this does not do the trick with subdomains for me. I tried a second rule:

www.** Forwarding URL (Status Code: 301 - Permanent Redirect, Url: https://$$2)

but this is not working unfortunately…

Who can help me solve this?


That looks like Deprecated - Subdomain too deep to me.

1 Like

Hi @domjh

It seems like this explains it all… thx for the ultra fast answer!

In that case I’ll set up CNAME records in the style of:

CNAME | | | Auto | DNS only

for now…

1 Like

No problem! You either need the $10/month cert from Cloudflare, or to set the record to :grey: as you said and handle the redirect on your server. Just note that with it set to :grey:, you are bypassing Cloudflare and your origin IP will be visible.

Since the target is usually an AWS Cloudfront or load balancer, I am not that concerned since that already has it’s own protection layer…

I’ll think about the $10/month investment if it grows to more than just 2-3 DNS records for that reason…

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.