I've been messing with my DNS settings and can't figure out how to get this to work...
I have G Suite for example.com
, with a (new) Google Sites app published and accepting www.example.com
. I have a CNAME in my DNS pointing www
to Google, so http://www.example.com/
and https://www.example.com/
both work, with the http
one doing a 301 to the https
version, which is exactly what I want.
In my DNS (at GoDaddy), I have the base domain redirecting to https://www.example.com
- so requests to http://example.com
get forwarded properly.
The one leftover is https://example.com/
- that one does not redirect because GoDaddy doesn't support it (I'd assume all hosting companies would be the same), but I want it to redirect like the others.
The only way I can think of is to have a live hosting account somewhere else, for https://example.com/
, and have that redirect the browser over to www
. I could do that with a static hosting (like Firebase) and use javascript, or app hosting with something like ASP.NET, and redirect directly in the response.
Is there an easier way, without using a separate hosting product?
(This might be a better question for ServerFault, but I figure I'd start here)