Reputation: 1253
I currently have the following configuration:
// firebase.json
{
"hosting": [
{
"rewrites": [{
"source": "/articles{,/**}",
"destination": "/articles"
},
{
"source": "**",
"destination": "/index.html"
}]
}
]
}
If I go to mysite.com/articles/<articleID>
I'm taken to mysite.com
when I'd expect to be taken to mysite.com/articles
. What am I doing incorrectly?
I'm following this documentation.
Upvotes: 2
Views: 2420
Reputation: 1253
I was able to resolve the issue after taking the following steps:
/articles{,/**}
to /articles/**
articles
to articles.html
which is a valid local filefirebase.json
don't change the behavior of the Firebase Hosting emulator until it is restarted.Upvotes: 1
Reputation: 615
I believe there are two possible causes.
mysite.com/articles
doesn't evaluate to a local file, it is caught by the second rewrite rule and redirected to index.html.Upvotes: 0