Firebase主机重写为html路由文件
有没有办法做到这一点?我想重定向到具有相同页面路径的html文件Firebase主机重写为html路由文件,firebase,next.js,firebase-hosting,Firebase,Next.js,Firebase Hosting,有没有办法做到这一点?我想重定向到具有相同页面路径的html文件 "rewrites": [ { "source": "/:page", "destination": "/:page.html", "type": 301 } ] 我已经弄明白了,只需将cleanUrls属性添加到firebase
"rewrites": [
{
"source": "/:page",
"destination": "/:page.html",
"type": 301
}
]
我已经弄明白了,只需将
cleanUrls
属性添加到firebase.json。正如书中所说
{
"hosting": {
"public": "out",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "/:page*",
"destination": "/:page",
"type": 301
}
],
"cleanUrls": true
}
}