I noticed recently some strange behaviour - I tried to configure CNAME wildcards for all the sites on my droplet, so that www.example.com, wwww.example.com, etc., all lead to example.com. This worked fine with the first/main site I made on my droplet, let’s call that main.com. So typo.main.com goes to main.com. The funny thing is, while I tried to set up the same pattern for the other sites on my droplet, typos such as wwww.othersite.com still take me to main.com. Bit of a n00b here, probably missing something obvious…
CNAME * mainsite.com. (works) CNAME * othersites.com (don’t work)
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Not completely sure if this is the source of the issue or just a typo in your question.
CNAME * mainsite.com. (works)
CNAME * othersites.com (don't work)
As they are written here the second record would not function since it is missing the .
at the end. Without this, the DNS system will consider this to be just part of the domain name.
I assume that these CNAME records are on separate domains since having multiple wildcards on one domain would not work properly since only the first one encountered would ever be used. If you can share your actual domain name or paste your zone files in their entirety it would make it much easier to assist you in getting this working as you want it.
Are both sites on same droplet ? If yes you could made some mistakes in Virtual Host (Server Block) config. What web-server you use ? There is possibility that you configured Virtual Host to redirect all domains to one html root
Yep they’re on the same droplet. I wonder if the issue has something to do with the “default server” setting? Using Nginx/Ubuntu: