开发者

GAE is not serving my robots.txt

开发者 https://www.devze.com 2023-02-23 02:26 出处:网络
I have the following defined in my app.yaml: handlers: - url: /favicon.ico static_files: img/favicon.ico

I have the following defined in my app.yaml:

handlers:
- url: /favicon.ico
  static_files: img/favicon.ico
  upload: noop

- url: /apple-touch-icon.png
  static_files: img/apple-touch-icon.png
  upload: noop

- url: /images
  static_dir: img

- url: /robots.txt
  static_files: media/robots.txt
  upload: noop

- url: /humans.txt
  static_files: media/humans.txt
  upload: noop

Th开发者_开发问答ere are other mappings after the declaration for /humans.txt but I'll remove them for brevity.

The noop directory is an empty directory.

However my browser gives me a 404 when I try to access these urls:

  1. http://myapp.appspot.com/humans.txt
  2. http://myapp.appspot.com/robots.txt

Why ?


Since you're using static files, upload should match the static_files location:

- url: /robots.txt
    static_files: media/robots.txt
    upload: media/robots.txt

- url: /humans.txt
    static_files: media/humans.txt
    upload: media/humans.txt
0

精彩评论

暂无评论...
验证码 换一张
取 消