I have a public folder like:
/public
index.html
/landing
index.html
/membership
index.html
/public/index.html is a SPA, so each request to /** should me rewritten to /index.html
/landing/ and /membership/ are two static HTML landings so each request should not be rewritten
firebase.json suggested by Google support:
{
"functions": {
"source": "functions"
},
"hosting": {
"public": "public",
"redirects": [{
"source": "/landing",
"destination": "index.html"
},
{
"source": "/membership",
"destination": "index.html"
}
],
"rewrites": [{
"source": "/membership/**",
"destination": "/membership/index.html"
}
],
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
}
}
Everything just gets redirected to /index.html...
Even tried with:
{
"functions": {
"source": "functions"
},
"hosting": {
"public": "public",
"redirects": [{
"source": "/landing/**",
"destination": "/landing/index.html"
},
{
"source": "/membership/**",
"destination": "/membership/index.html"
}
],
"rewrites": [{
"source": "**",
"destination": "/index.html"
}
],
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
}
}
Same result, everything just goes to /