Firebase: URL Rewrites/Redirect with URL Variables

别等时光非礼了梦想. 提交于 2021-01-28 07:05:09

问题


I want to access example.com/folder/value1/value2/ on a Firebase hosted website and load content from example.com/folder/index.html?var1=value1&var2=value2 while keeping the new URLs (not redirecting to the .html page with variables in it).

I have tried the following but it returns a 404 error:

rewrites": [ {
    "source": "/folder/:value1*/:value2*/",
    "destination": "/folder/index.html?var1=:value1&var2=:value2"
  }

Any ideas if this is possible in Firebase? Similar to htaccess rewrites?


回答1:


Firebase Hosting rewrites only rewrite the file path, not query parameters. It is not possible to use captures in rewrites (only in redirects), and the destination must be an exact path to a deployed static file.



来源:https://stackoverflow.com/questions/57312720/firebase-url-rewrites-redirect-with-url-variables

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