Redirect third-level domain

We currently have a record created for sample.domain.com.

We have users typing in www.sample.domain.com.

What is the best way to get the www to redirect?

We have a lot of subdomains so would love to use a wildcard rule of some sort.

There are a few issues:

  1. Cloudflare doesn’t proxy wildcard entries unless you’re on an Enterprise plan. You’d need to create a DNS entry for every single one.
  2. Cloudflare’s Universal SSL doesn’t cover third level domains. You’d need Advanced Certificate Manager ($10/month) if those hostnames end up with HTTPS.
  3. Then you can create a Page Rule: Match www.*.domain.com/* and Forward URL (301) to https://$1.domain.com/$2 (the $ variables represent the * from the Match.

NOTE: That’s weird. The preview showed the $2.

1 Like

https://$1.domain.com/$2

1 Like

Filthy capitalists!

:crazy_face:

1 Like

Thank you! I think I am tracking. So even though I really just want to do a redirect, I will need a DNS record and a Advanced Certificate (for 3rd level domain).

Too bad the Page rule can’t just intercept the incoming third level domain and redirect to a set DNS value.

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