jesica
jesica

Reputation: 685

Using Cloudflare SSL certificate for Subdomain with www

I am looking to have a solution for using Cloudflare Dedicated SSL certificate for my website subdomains. I have purchased the $10/month package with the expectation that I could setup a wildcard hostname with the www.

I want my subdomains to load with the SSL certificate and I have more than 100 subdomains available for my domain. I don’t want to add each subdomain with www as a hostname but use a wildcard format.

I am inspired after reading the following posts -

https://community.cloudflare.com/t/page-rule-forwarding-with-subdomain-and-wildcards/136977 https://community.cloudflare.com/t/subdomain-too-deep/81872

My current hostnames are -

.example.com, example.com, .www.example.com

I added *.www.example.com to work for subdomains like www.sub.example.com but it seems not working! I think the wildcard format is incorrect.

I want my SSL certificate works for all addresses like below. -

example.com
www.example.com
sub1.example.com
www.sub2.example.com
sub2.example.com
www.sub2.example.com

I am quite confused if it's really possible with Cloudflare!

Thanks for the help!

Upvotes: 0

Views: 1323

Answers (1)

Paolo Tagliaferri
Paolo Tagliaferri

Reputation: 1021

As reported on the Cloudflare Support article

Dedicated certificates with Custom Hostnames can cover additional levels of subdomains (ex: test.dev.www.example.com instead of just www.example.com)

So you should be able to create a Dedicated Certificate which covers example.com *.example.com *.sub1.example.com *.sub2.example.com, which should work for:

example.com
www.example.com
foo.example.com
www.sub1.example.com
bar.sub1.example.com
baz.sub2.example.com
www.sub2.example.com
[...] 

And so on. In your message, you mention adding *.www.example.com to the certificate to cover for subdomains like www.sub.example.com - but this does not look correct, as you would need *.sub.example.com added instead.

Upvotes: 1

Related Questions