我该如何配置app.yaml
文件以将所有 URL 重定向到另一个 URL?例如,我想要http://example.appspot.com/hello
或 http://example.appspot.com/hello28928723
都重定向到http://example.com
。
目前我只提供静态文件。以下是我的app.yaml
文件:
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
RedirectHandler
,但是出现了错误File "/usr/local/lib/python2.7/dist-packages/webapp2_extras/routes.py", line 157, in __init__ setattr(route, self._attr, prefix + getattr(route, self._attr)) TypeError: cannot concatenate 'str' and 'type' objects
。 - Christian