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.
– dhauptman
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!
– Fernando Liell
To redirect http to https include
secure: always
andredirect_http_response_code: 301
in the elementhandlers
. More information here.– dhauptman
Secure:Always worked, thank you very much! the redirect_http_response_code:31 failed to implement ;(
– Fernando Liell