Google App Engine上的sitemap.xml

时间:2014-02-02 18:14:42

标签: google-app-engine web search-engine web-crawler yaml

我的Google App Engine网站有以下yaml文件。

application: <my-app-id>
version: 1
runtime: python27
api_version: 1
threadsafe: true

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

- url: /
  static_files: static/index.html
  upload: static/index.html

- url: /
  static_dir: static

当我使用本地服务器测试此应用程序时,可以通过导航到访问文件sitemal.xml。

 http://localhost:8080/sitemap.xml

但是,当我部署应用程序时,导航到以下页面只是将我重定向到index.html(无法下载xml文件)。

 http://<my-domain>.net/sitemap.xml
 http://www.<my-domain>.net/sitemap.xml

为什么本地版本的行为与部署版本不同?如何在已部署的版本中使文件可用?

2 个答案:

答案 0 :(得分:1)

Google App Engine doesn't support naked domains,很有可能它没有被正确重定向。尝试通过http://www.<my-domain>.net/sitemap.xml访问它,看看是否有效。

答案 1 :(得分:0)

事实证明问题是由域重定向引起的。如果我通过以下方式直接访问应用程序。

http://<app-id>.appspot.com/

然后一切都很好。显然,域托管服务处理重定向的方式有所破坏。