У меня есть общая папка, например:
/public
index.html
/landing
index.html
/membership
index.html
/ public / index.html - это SPA, поэтому каждый запрос к / ** должен переписываться в /index.html
/ Landing / и / members / - это две статические привязки HTML, поэтому каждый запрос не следует переписывать
firebase.json, предложенный службой поддержки Google:
{
"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/**"
]
}
}
Все просто перенаправляется в / index.html ...
Даже пробовал с:
{
"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/**"
]
}
}
Тот же результат, все просто идет к /