SSL configuration with Google AppEngine - redirect

2019-09-18 07:12发布

问题:

I have created an app on AppEngine, and setup my custom domain name on Google Apps. Both the naked domainenter link description here name and www subdomain work well.

The issues start when I want to setup SSL.

I have a certificate for the domain: www.mydomain.com, and the setup worked well in Google Apps. I also configured my app.yaml to secure: always, so all requests to http://www.mydomain.com go to https://www.mydomain.com, and all is well.

While all this is working, a request to the naked domain: http://mydomain.com redirects to https://mydomain.com, and fails because Google doesn't support SSL certificates on naked domains (also because I issued my certificate only for www.mydomain.com)

So now I want to redirect my naked domain http://mydomain.com to http://www.mydomain.com, and it should all work like magic. To do this, I follow the instructions here, which links to this page: 'Enable your "naked" domain address'.

But following those simple instructions, here is the error I get (see screenshots):

Any idea how to make the naked domain redirect to the www subdomain?

回答1:

It looks like wwwizer.com does the trick.

I just created a simple A record pointing to wwwizer's IP in the DNS entries of my domain manager, and it's working. For free.

http(s)://mydomain.com now redirects properly to https://www.mydomain.com

Hopefully AppEngine will add native support for this at some point...