How to redirect www.mysite.appspot.com to mysite.appspot.com

40 views
Skip to first unread message

David Smith

unread,
Aug 13, 2019, 12:43:57 PM8/13/19
to Google App Engine
Hi, I've asked this question on stackoverflow but it's not getting much attention:


If a user incorrectly uses www in the URL they can not get through at all and it looks like a really suspicious site.

The short question is, how do I redirect www.mysite.appspot.com to mysite.appspot.com just using the app.yaml file?

This must be a really stupid question because I've searched for hours and found nothing to answer it.

This is more detail in the SO question which I can insert here if you think that's best.

Thanks,

Dave

George (Cloud Platform Support)

unread,
Aug 13, 2019, 2:47:19 PM8/13/19
to Google App Engine
Hello David, 

You can use www.mysite.appspot.com and mysite.appspot.com interchangeably: you get to the same page in both cases. 

You may consider using  a custom domain instead, and map it to your appspot.com domain, as detailed on the "Mapping Custom Domains" documentation page

Alex Martelli

unread,
Aug 13, 2019, 4:08:21 PM8/13/19
to google-a...@googlegroups.com
A simple example of how to do redirection in App Engine Python apps has been written by an independent consultant and posted at their site, https://www.the-swamp.info/blog/google-app-engine-redirection-naked-domain-www/ -- it includes a link to a github repo, also owned by the article's author, with examples using Python with either of the webapp2 or Flask web app frameworks. I'm not familiar with how to perform the same task with programming languages different from Python (or with Python and different frameworks, such as Django) but simple Google searches (such as [app engine redirect django] and the like) seem able to help.

Alex


--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/0cf977ca-6182-4f83-b79e-32e86ef4a13d%40googlegroups.com.

David Smith

unread,
Aug 13, 2019, 11:59:54 PM8/13/19
to Google App Engine
Hi George,
This does not seem to be the case:

If you go to www.givebackourbusses.appspot.com you get a 'Did Not Connect: Potential Security Issue' message.

Without www it serves okay: givebackourbusses.appspot.com.
Reply all
Reply to author
Forward
0 new messages