Firebase托管例外重写属性

时间:2016-08-10 11:36:40

标签: firebase firebase-hosting

在Firebase中,我不想将所有网址(" / docs")发送到index.html

但它没有用。没有考虑例外。所有网址都路由到index.html。

这是我的firebase.json:

{
  "hosting": {
    "public": "target",
    "rewrites": [
    {
      "source": "/docs",
      "destination": "/docs.html"
    },{
      "source": "**",
      "destination": "/index.html"
    }],
    "headers": [
      {
        "source": "**/*",
        "headers": [
          {"key": "X-Content-Type-Options", "value": "nosniff"},
          {"key": "X-Frame-Options", "value": "DENY"},
          {"key": "X-UA-Compatible", "value": "ie=edge"},
          {"key": "X-XSS-Protection", "value": "1; mode=block"}
        ]
      },

      {
        "source": "**/*.@(css|html|js|map)",
        "headers": [
          {"key": "Cache-Control", "value": "max-age=3600"}
        ]
      }
    ],
    "cleanUrls": true,
    "trailingSlash": false
  },

  "rules": "./firebase.rules.json"
}

那是我的目标"夹

target folder

1 个答案:

答案 0 :(得分:0)

似乎我只需要等待配置刷新..我现在检查它正在工作..