How to permanently redirect `http://` and `www.` URLs to `https://`?

后端 未结 6 1197
粉色の甜心
粉色の甜心 2020-12-24 11:34

I have a Google App Engine project. On this project I have setup a custom domain and an SSL certificate. Therefore, I can use https://www.mysite.xxx, http

6条回答
  •  臣服心动
    2020-12-24 12:30

    (For Node at least,) in your app.yaml, add the following:

    handlers:
    - url: /.*
      secure: always
      redirect_http_response_code: 301
      script: auto
    

    Reference: https://cloud.google.com/appengine/docs/standard/nodejs/config/appref

提交回复
热议问题