views:

697

answers:

1

Hi, how do I have to configure the app.yaml file to redirect all urls to a certain url? Example I want http://test.appspot.com/hello or http://test.appspot.com/hello28928723 to redirect to http://domain.com

I am only serving static files at the moment. Here is my app.yaml file:

application: testapp
version: 1
runtime: python
api_version: 1

handlers:
- url: (.*)/
  static_files: static\1/index.html
  upload: static/index.html

- url: /
  static_dir: static

Thanks, Max

+3  A: 

you can redirect all requests easily with a python handler. Something like

class FormHandler(webapp.RequestHandler):
  def post(self):
    if processFormData(self.request):
      self.redirect("http://domain.com")
diega