【发布时间】:2013-07-25 07:43:24
【问题描述】:
我正在尝试在 Google AppEngine 上托管一个简单的静态网站,但在设置自定义 404 页面时遇到了问题。
我的app.yaml 为所有请求提供静态文件(来自www 子目录):
application: id
version: v
runtime: python27
api_version: 1
default_expiration: "1d"
threadsafe: yes
handlers:
- url: (.*)/
static_files: www\1/index.html
upload: www/index.html
- url: /
static_dir: www
error_handlers:
- file: 404.html
但在尝试访问不存在的文件时,我没有看到 404.html,而是默认的 GAE 错误消息。
日志显示:
Static file referenced by handler not found: www/does-not-exists/index.html
或
Static file referenced by handler not found: www/does-not-exists.html
我做错了什么?
【问题讨论】:
标签: google-app-engine error-handling http-status-code-404