Search code examples
htmlfirebasefirebase-hosting

Firebase hosting index.html only shows when specified in the URL `/index.html`, default/home page "Site not found"


In my firebase URL, when I go to https://example.web.app, it says "Site not found" from Firebase.

But if I would go to https://example.web.app/index.html, the URL would work and it would show the index.html page.

How would I make it so it would point to the default page aka home page, instead of me having to redirect to the index.html page?

firebase.json:

{
  "database": {
    "rules": "database.rules.json"
  },
  "hosting": {
    "public": "dist",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  }
}

dist/index.html exists. dist directory is used for the public hosting.

index.html works fine when I redirect to https://example.web.app/index.html, but doesn't work when I go to https://example.web.app, how would I fix that?

The URL is just an "example," to try to explain to you guys. This is not the ACTUAL URL.


Solution

  • The best option is to contact Firebase customer support and ask help from them.