我想根据查询参数提供静态文件。更具体地说,我想为搜索引擎优化提供预渲染快照。这些页面托管在 Google Appengine 上,因此我使用 app.yaml 来定义这些 url。
handlers:
# Consider anything matching a dot static content.
- url: /(.*\..*)$
static_files: dist/\1
upload: dist/(.*\..*)$
# Serve snapshots for seo
- url: /?_escaped_fragment_=(.*)
static_files: dist/snapshots/\1
upload: dist/(.*)$
# Otherwise let Angular handle it.
- url: /(.*)
static_files: dist/index.html
upload: dist/index.html
但是,当我使用查询参数获取 url 时_escaped_fragment_
,会触发最后一个 url 处理程序。是否可以在 url 中定义查询参数?如果是这样,我做错了什么?