Search code examples
reactjsgoogle-app-enginegoogle-cloud-platform

Website is not loading without https://www


I have developed a website and deployed it via Google App Engine. But when I open the website with full url let's say "https://www.website.com" it opens but when I type "website.com" in url section of the browser it doesn't opens and says the site is not secure. How can I resolve this?


Solution

  • It looks like a couple of things are happening

    1. If you just type in 'website.com', the browser will try to open 'http://website.com' (note there is no subdomain -www i.e. you are using the naked domain) unless you have done a redirection to 'www' in which case, you will get 'http://www.website.com'

    2. If you have specified 'secure' always in your 'app.yaml' file, then GAE will redirect the 'http' to 'https'

    3. It seems like

      a) You have specified 'secure always' in your app.yaml file

      b) You are not redirecting naked domain to sub-domain

      c) You have mapped the sub domain, 'www' to your GAE appspot domain. You have not mapped the naked domain

    Solution

    1. Map both naked and subdomain (www) of your custom domain to your appspot.com urls
    2. Enable SSL for both mappings