php - Google Cloud App Engine - How to create subdomains and redirect access to another file/folder? -
i have php5.5 module created on google cloud's app engine , sql module on google cloud sql.
here php app.yaml:
application: myapp version: 1 runtime: php55 api_version: 1 handlers: - url: /.* script: index.php
i new google cloud, need somehow create subdomain such subdomain.myapp.com
, when users try access http://subdomain.myapp.com
instead of http://myapp.com
, want server "give" them /subdomain/index.php
file instead of /index.php
file.
add both myapp.com
, subdomain.myapp.com
domains app in developer console, see q&a: google cloud dns: point naked domain www?
add subdomain
module app serve subdomain-specific files.
add dispatch.yaml
file dispatch requests based on domain respective module, see q&a: appengine subdomains modules without wildcard mapping
note: if use ssl , sessions cross-domain navigation you'll need wildcard certificate otherwise you'll encounter ssl errors.
you might able away single module (lower instance uptime usage/costs) if tolerate distinct paths in urls, http://subdomain.myapp.com/subdomain/index.php
- in /index.php
you'd need parse domain in requested url , if it's subdomain
1 re-direct distinct path instead. no dispatch file needed in case. not clean other solution, imho.
Comments
Post a Comment