Search code examples
firebasednshttp-status-code-404hosting

Why firebase custom domain don't return index.html?


I have a proyect in firebase, with two custom domains, as show de image firebase console.

With the fist one, colademonofrozen.cl/ I get index.html file OK, but with the second, www.colademonofrozen.cl/ I get 404 not found.

Some strange thing about this case is that www.colademonofrozen.cl/anything display index.html file OK.

This is the hosting configuration: `

  "hosting": {
    "public": "dist",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "/api/**",
        "function": "app",
        "region": "us-central1" 
      },
      {
        "source": "/admin",
        "destination": "/admin.html"
      },
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  },

`

I worked a lot for this project, I really appreciate any ideas.

I also appreciate anyone confirming that the domain shows an error page, so the problem cannot be ignored if it starts working.

  • I confirmed that it is not a cache problem.
  • The subdomain is configured more than two weeks ago, is not time propagation problem.
  • I requested a redirect at my dns provider, from the subdomain www.colademonofrozen.cl/ to colademonofrozen.cl/, but is not posible if the domain points to Firebase.

To my bad luck, the back label of the product for which I created the project are already printed. see back label!


Solution

  • I change following DNS record:

    name type value
    www.colademonofrozen.cl. CNAME colademonofrozen.cl

    for:

    name type value
    www.colademonofrozen.cl. A 199.36.158.100

    Now works OK.