Search code examples
firebasewebfirebase-hosting

Remove file extensions for html files in firebase


In firebase.json, is there a way to rewrite (not redirect) all requests to the corresponding .html file but leave other extensions?

for example, https://example.com/foo will be the same as https://example.com/foo.html.

But https://example.com/data will not be the same as https://example.com/data.xml.


Solution

  • This is the cleanUrls option (as in the docs) in firebase.json:

    {
      "hosting": {
        "cleanUrls": true
      }
    }