My setup are,
- @ redicrect to www.example.com
- www.example.com
CNAME to openshift account.
- https redirection is handled in the code.
Working:example.com
-> https://www.example.com
www.example.com
-> https://www.example.com
Not Workinghttps://example.com
-> "This site can’t be reached"
- I expect to redirect this to https://www.example.com
Any idea how to do this?
The problem with your requirement is that DNS does not actually know anything about the protocol/scheme (either http://
or https://
), it only handles the hostname resolution. The part where you redirect from example.com
to https://www.example.com
, although configured in namecheap DNS console, actually involves a kind of a web server which (when you make a request for http://example.com) responds with 301 Redirect
to https://www.example.com
- that is a service that DNS providers sometimes transparently offer to make life easier for their customer.
I am not familiar with namecheap offering, but I doubt that it is possible to configurehttps://example.com
to https://www.example.com
, since that would also have to involve that you somehow upload your SSL certs, but perhaps you can check with their support.
The other soultion might be that in namecheap console, instead of example.com
-> https://www.example.com
you configure example.com
CNAME to openshift account. Then, in openshift you just make sure that your site responds to example.com
also, and handle the http -> https
redirection in code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With