I'm trying to setup Cloudflare so my www subdomain doesn't redirect to the http naked domain and do exactly the opposite: mydomain.com redirecting to www.mydomain.com

Cloudflare automatically configures the DNS records this way:

Type: A
Name: 'mydomain'
Value: 'public ip number'

Name: www
Value: alias of `mydomain`

Any idea how to do this?


CloudFlare is setting up the domain. Since it is used to work with the main domain. Techincally speaking the "www." prefix is always a subdomain/CNAME/alias of the main domain.

You're all fine with CloudFlare configuring the domain without www since you're able to control both the non-www and www part of it.

So for the DNS settings, everything looks fine. Now for the eventually used redirects from non-www to www, you can take a look into CloudFlare page rules.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.