小编tay*_*mer的帖子

Firebase在子文件夹中的单页VueJS应用程序中重写

背景

我有一个结构如下的网站:

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的.

javascript firebase vue.js firebase-hosting

3
推荐指数
1
解决办法
461
查看次数

标签 统计

firebase ×1

firebase-hosting ×1

javascript ×1

vue.js ×1