我想访问Firebase托管网站上的example/folder/value1/value2/,并从example/folder/index.html加载内容?var1 = value1&2 = value2,同时保留新网址(不重定向到其中包含变量的.html页面.
I want to access example/folder/value1/value2/ on a Firebase hosted website and load content from example/folder/index.html?var1=value1&var2=value2 while keeping the new URLs (not redirecting to the .html page with variables in it).
我尝试了以下操作,但它返回404错误:
I have tried the following but it returns a 404 error:
rewrites": [ { "source": "/folder/:value1*/:value2*/", "destination": "/folder/index.html?var1=:value1&var2=:value2" }有什么想法可以在Firebase中实现吗?类似于htaccess重写吗?
Any ideas if this is possible in Firebase? Similar to htaccess rewrites?
推荐答案Firebase Hosting仅重写文件路径,而不重写查询参数.不可能在重写中使用捕获(仅在重定向中使用),并且目标必须是部署的静态文件的确切路径.
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.
更多推荐
Firebase:使用URL变量进行URL重写/重定向
发布评论