app.yaml :将任何以 / 结尾的 URL 重定向到 {url}/index.html

问题描述

我正在尝试在 Google 应用引擎中部署我们的网络应用。我想将任何以 / 结尾的 url 重定向到 {url}/index.html 例如/crm/features/ 被重定向到 /crm/features/index.html。我的 app.yaml 结构在下面指定

runtime: PHP55
api_version: 1
#threadsafe: true


handlers:
- url: /
  static_files: static/index.html
  upload: static/index.html

# Serve PHP scripts.
- url: /mail/.*
  script: static/mail/mailsender_1.PHP
# index files
- url: /\w+/(\w+-*\w+)+/.*
  static_files: static/\w+/(\w+-*\w+)+/index.html
  upload: static/\w+/(\w+-*\w+)+/index.html
- url: /(.*)$
  static_files: static/\1
  upload: static/(.*)\.(js|css|png|jpg|jpeg|map|woff|ico|svg|woff2|ttf)
- url: /.*   #everything else after slash ends up here
  static_files: static/index.html
  upload: static/index.html

最近几个小时我一直在挣扎。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)