Redirect 301 - Google App Engine Platform

Asked

Viewed 64 times

1

I use the Google Cloud App Engine Platform to Host Static Site and I’m having trouble doing the Redirect 301 of the version WWW for NOUN-WWW and also the version Http for Https.

The Server is Google Frontend This is the Main Domain - https://presencadigital.co

I would like the versions below to be redirected to the Main Dóminio https://www.presencadigital.co http://www.presencadigital.co http://presencadigital.co

The File I use to make the Deploy is APP.yaml, through the Gcloud Interface.

App.yaml

runtime: php55 
api_version: 2.3

handlers:
   url: /
   static_files: index.html
   upload: index.html
   expiration: 0s
   http_headers:
     Link:  <assets/img/logoWebPresencaDigitalTransparent.png>; rel=preload; as=image

I researched about Redirect and what they use is the Htaccess file, for APACHE Servers, I do not know how to implement through the app.yaml.


Updating

Following the hint of @dhauptman put the tag "Secure:Always" in each upload declaration of the app.yaml and solved the http -> https problem

handlers:
   url: /
   static_files: index.html
   upload: index.html
   secure: always
   expiration: 0s

Problem now is how to use redirect_http_response_code: 301 to point to the domain www.presencadigital.co -> presencadigital.co

  • What problem exactly are you having? I recommend following this one’s instructions link.

  • The Domain Mapping already works, the problem is when I use for example the http address, I would like the Server to redirect to the https address. I just updated the issue of!

  • To redirect http to https include secure: always and redirect_http_response_code: 301 in the element handlers. More information here.

  • Secure:Always worked, thank you very much! the redirect_http_response_code:31 failed to implement ;(

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.