问题
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