我有一个结构如下的网站:
root
— /public
— index.html <— landing page
— 404.html
— /library
— index.html <— single page VueJS app
Run Code Online (Sandbox Code Playgroud)
单页应用程序可在此处找到:https://uxtools-3ac6e.firebaseapp.com/library/
这是我的firebase.json:
{
"database": {
"rules": "database.rules.json"
},
"hosting": {
"public": "public",
"rewrites": [
{
"source": "/library/*",
"destination": "/library/index.html"
}
]
}
}
Run Code Online (Sandbox Code Playgroud)
当应用程序开始路由到子路径时,例如https://uxtools-3ac6e.firebaseapp.com/library/lists/order-group-best-sources-learn-ux,刷新将重定向到404而不是库/索引html的.