CORS doesn't work on specific domain

Hi guys, I have a very interesting situation. In my app I’ve set

'Access-Control-Allow-Origin', '*'

And it works great. I can do an ajax request right here from stackoverflow by chrome console. However there is a specific domain, let’s call it https://example.com
Whenever I do an ajax request from this domain I get CORS origins error even though my headers are set. Intereting thing to note with this domain is that if I go directly to example.com it gives an invalid url error. I need to go explicitly to https://example.com for that website to work. So I wander if this has anything to do with me not being able to do an ajax request? Maybe there some redirects? How can I work around this?