1

我正在使用谷歌应用引擎来托管我的网站。我试图上传 sitemap.xml,但是当我打开链接时,即 www.example.com/sitemap.xml 它显示Oops! This link appears to be broken.。我不知道这是什么原因。谁能告诉我我做错了什么?

这是我的 app.yaml 文件的内容

application: mywebsite
version: 1
runtime: python
api_version: 1

handlers:
- url: /(.*\.(gif|png|jpg|ico|js|css))
  static_files: \1
  upload: (.*\.(gif|png|jpg|ico|js|css))



- url: .*
  script: main.py

- url: /icon\.ico
  static_files: icon.ico
  upload: icon.ico

- url: /sitemap.xml    
  static_files: static/sitemap.xml
  upload: static/sitemap.xml

- url: /static
  static_dir: static
4

1 回答 1

4

From here, "Patterns are evaluated in the order they appear in the app.yaml, from top to bottom. The first mapping whose pattern matches the URL is the one used to handle the request.".

You should try moving the catch all handler (url: .*) to the end of the file.

于 2012-12-27T08:29:11.807 回答