You want to redirect
foo.com (a few A records) to
www.foo.com (CNAME),
not vice versa.
This way you can utilize the geolocality feature.
You will be stuck with round robin rotation using A records.
On May 2, 1:15 pm, Matteo Crippa <
matteo.cri...@gmail.com> wrote:
> With reference to the manual you have to do this to have a permanentredirect:
>
> redirect(uri, permanent=False)
> A shortcut method for handlers to use to return aredirect
> response. Sets the HTTP error code and Location: header toredirectto
> uri, and clears the response output stream. If permanent is True, it
> uses the HTTP status code 301 for a permanentredirect. Otherwise, it
> uses the HTTP status code 302 for a temporaryredirect.
>
> soredirect(url,True)
>
> the only problem i'm dealing with at this moment is connected to the
> fact that environ var doesn't have any reference to DOCUMENT_URI or
> SCRIPT_URI and going on...
>
> you can try with HTTP_HOST or SERVER_NAME, and then looking at
> PATH_INFO in order toredirectthe request to the right place in the
> > The default is a temporaryredirect. There is a parameter you set if
> > you want it to be permanent - which you probably want to do.
>
> > It might be OK toredirectall 'www' requests to the same location. It
> > handles just fine the case where people typed it by mistake. Is there
> > any other reason to have 'www' work at all?
>
> > On May 1, 6:30 am, Matteo Crippa <
matteo.cri...@gmail.com> wrote:
>
> > > the quickest way could be the one you point only your www-less domain
> > > to GAE and all the other to your existing hosting and on www root
> > > place a .htaccess or index.php with a 301redirectto
digglicious.com
>
> > > on the other hand you can try do something like this
>
> > > from os import environ
>
> > > and then on in your app
>
> > > if "
www.digglicious.com" in environ['HTTP_HOST']:
> > > self.redirect("
http://digglicous.com")
>
> > > this is only for base case on root, you will have to work also on all
> > > other urls redict, you can do this using environ['REQUEST_URI']
>
> > > Btw never tested it, and i don't know which kindaredirect(i don't