App engine subdomain redirects on static files (HTTP 301) -


i have domain (let's say) example.com , want serve content (mainly static files - client side app) naked domain. want accept subdomains, not end in error because of dns or 404. common users put www in front of domain (for whatever reason).

i did set custom domains in appengine console, naked , * (wildcard). shows dns records need have, set them too... same, a/aaaa records pointing appengine ips , * cname appengine alias (googlehosted).

i have read how behaves default on https://cloud.google.com/appengine/docs/domain?csw=1 , change bit. page accessible domains example.com, www.example.com, blog.example.com etc.

what redirect request going else naked domain naked domain without adding script handler.

with apache , modrewrite solution easy, has rewritecond %{http_host} , rewriterule ^(.*)$ http://example.com/$1 [r=301,l]... possible app.yaml? couldn't find @ https://cloud.google.com/appengine/docs/python/config/appconfig.

i don't want redirect in javascript (doesn't work images, css, etc) , don't idea of script handler files, imho needs have performance penalty.

so, seem want have subdomains redirect naked domain, without needing write handler. while use cname wildcard on subdomains in zone file direct "@", naked domain, inadvisable since not every provider supports it. can read more strange edge case in otherwise standardized system dns here.

while use dispatch file (python doc, other languages have similar) catch subdomain requests , send them special, simplified "3xx redirect naked domain" module, short of hosting gce instance frontend running apache, won't able change user's address bar cname method, although directed ip addresses (a/aaaa records) specified @ apex level of zonefile ("naked domain"), unless implement such module. apache rewrite rules send such http 3xx responses redirect browser change url , request specified url (in case, naked domain).


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -