google-cloud-platformnamecheapcustom-domain

Google Cloud Custom Domains NameCheap - "WWW" not working


I have purchased a domain on https://www.namecheap.com/. I also have a Cloud Run service running on Google Cloud. I verified my domain on Google and I added it as a Custom Domain. In return Google gave me the DNS recordsdns Records

All I had to do was to go to NameCheap and add these records which I did. ipv4

ipv6

I can accces my site website like this https://abcd.com but not like this https://www.abcd.com with (WWW). Any ideea why?

Later Edit: here is the error enter image description here

CURL error: enter image description here


Solution

  • In order to have both the apex domain (abcd.com) as well as the www.abcd.com subdomain mapped to the same Cloud Run app you need to create both such mappings on the Cloud Run page.

    domain mappings

    You already have you apex domain mapped and the mapping produced a list of records you had to create with your DNS provider (A and AAAA records)

    apex mapping

    After creating this second mapping (www.abcd.com) Cloud Run will ask you create another (CNAME) DNS record (www.abcd.com -> ghs.googlehosted.com).

    www. mapping

    All together you have to have 8 A/AAAA records and 1 CNAME records with your DNS provider after you are done

    dns records

    After the CNAME record is created and verified, the certificate will be issued, and then you should be able to access your application with both apex and subdomain(s).