我有以下yaml文件用于我的Google App Engine网站。
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为什么本地版本的行为与部署的版本不同?要使该文件在展开版本中可用,我可以执行哪些操作?
发布于 2014-02-03 04:18:30
谷歌应用程序引擎doesn't support naked domains,最有可能的是它没有被正确重定向。尝试通过:http://www.<my-domain>.net/sitemap.xml访问它,看看是否有效。
发布于 2014-02-03 20:31:58
原来这个问题是由域名重定向引起的。如果我通过以下方式直接访问应用程序。
http://<app-id>.appspot.com/那么一切都很好。显然,域名托管服务处理重定向的方式有问题。
https://stackoverflow.com/questions/21514302
复制相似问题