remove file extension google app engine

蓝咒 提交于 2019-12-07 20:26:48

问题


I uploaded my client's webpage using google app engine and it is working fine. It is a very simple webpage with 12 static files (.html all of them)

I have to remove the file, but I don't know if this can be done modifying the app.yaml or the main.py

For example: I have www.example.com/page.html, I want www.example.com/page


回答1:


You can try this on your app.yaml assuming all your html files are in static folder.

handlers:

- url: /(.+)
  mime_type: text/html
  static_files: static/\1.html
  upload: static/(.+)

Meaning it will match all and look up static folder with .html extension if you want specific files you can do

- url: /(hello|world)
  mime_type: text/html
  static_files: static/\1.html
  upload: static/(.+)

means files hello.html and world.html only, to avoid handling all urls.




回答2:


If you are looking at removing the file, I do not think you can directly do that via the Administration Console or any utility.

You will need to remove the files from your local project and then upload the same again.



来源:https://stackoverflow.com/questions/20207703/remove-file-extension-google-app-engine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!