Google App Engine: Only serve existing files in static directory

时间:2016-04-12 00:54:31

标签: google-app-engine

Is there a way to only serve existing files in a static directory? For example in my app.yaml file I have

- url: /img
  static_dir: img

Which works fine if you go to /img/exists.jpg. However if you go to /img/doesnt-exist.jpg you get an ugly Error: Not Found message. Is there a way to make it skip this file and go to this script so that I can add a custom 404 message?

- url: /.*
  script: index.php

1 个答案:

答案 0 :(得分:0)

根据当前文档,您可以configure a custom error response