SOLVED How to allow website to be accessed using a wildcard instead of www

GrahamWebb

Member
Aug 15, 2023
5
1
3
UK
cPanel Access Level
Root Administrator
Hi we have a cpanel server and when we create a new account the site normally sets up the www hostname that the site will respond on as well as a few others. I have been asked if its possible to have the site respond using a wildcard, for example anythingyouwant.website.company.com should return the same site as www.website.company.com. Is there a page on the Cpanel interface where we can add additional hostnames or a hopefully a wildcard *.website.company.com? I have already setup a wildcard CNAME record so that *.website.company.com resolves to the IP of our Cpanel server but we need to tell the cpanel account to use it. Sorry if this does not make sense. I have been doing some Google searches but everything that comes up seems to assume you are using cpanel to manage DNS.
 
Last edited by a moderator:

GrahamWebb

Member
Aug 15, 2023
5
1
3
UK
cPanel Access Level
Root Administrator
I have done some more digging with Google and it seems I have to add the wildcard entry to the 'serveralias:' line of the Apache config file for the site. I am going to try this but we use AutoSSL for the site so is there a way to get the AutoSSL to give us a wildcard certificate or will be have to add a wildcard certificate manually?
 

ffeingol

Well-Known Member
PartnerNOC
Nov 9, 2001
942
421
363
cPanel Access Level
DataCenter Provider
You can do this through cPanel. Just go to Domains and then click the "Create a New Domain" button. In the domain field you can enter *.mydomain.tld (using your domain name). You then need to decide what you want for the document root.

cPanel's Let's Encrypt will create a wildcard cert by default. I don't know what the cPanel provider does for AutoSSL.
 

GrahamWebb

Member
Aug 15, 2023
5
1
3
UK
cPanel Access Level
Root Administrator
You can do this through cPanel. Just go to Domains and then click the "Create a New Domain" button. In the domain field you can enter *.mydomain.tld (using your domain name). You then need to decide what you want for the document root.

cPanel's Let's Encrypt will create a wildcard cert by default. I don't know what the cPanel provider does for AutoSSL.
Thanks ffeingol but does that apply if we are not using the cpanel to manage our DNS? Our DNS is manage separately using DigitalOcean?
 

GrahamWebb

Member
Aug 15, 2023
5
1
3
UK
cPanel Access Level
Root Administrator
You can do this through cPanel. Just go to Domains and then click the "Create a New Domain" button. In the domain field you can enter *.mydomain.tld (using your domain name). You then need to decide what you want for the document root.

cPanel's Let's Encrypt will create a wildcard cert by default. I don't know what the cPanel provider does for AutoSSL.
Thanks ffeingol, that has worked, we are currently using Sectigo Cpanel AutoSSL but that has not given me a wildcard certificate saying that the domain is excluded but half way there now.
 
  • Like
Reactions: cPRex

GrahamWebb

Member
Aug 15, 2023
5
1
3
UK
cPanel Access Level
Root Administrator
What I posted would take care of cPanel/Apache setup. You'd have to see if DigitalOcean DNS supports a wildcard.
We have the DNS part of it working as anything.website.company.com resolves to the ip address, its just Cpanel Sectigo now are not issuing a wildcard certificate.

I think I have found the issue now, we need to purchase a wildcard certificate if using Cpanel AutoSSL through Sectigo, or perhaps try LetsEncrypt.

No certificate available. The configured AutoSSL provider does not support explicit wildcard domains. You must purchase a certificate to secure this domain.