I'm attempting to use the firebase.json configuration to reroute language urls. Using rewrites, I'd like to implement the following priority order of redirection/rewrites:
1. /some/saved/path/zh-HANS-CN/test.html
2. /some/saved/path/zh-CN/test.html
3. /some/saved/path/zn/test.html
4. /some/saved/path/en/test.html
If a request for /some/saved/path/zh-XYZ/test.html comes in, I'd like it and all other region (XYZ portion) variations I don't support to use the /some/saved/path/zh/test.html page content, and if that doesn't exist then use the 'en' content.. That means my firebase.json Rewrite rules would look like:
"rewrites" : [{
"source" : "/:somepath*/zh-!(CN)/:somepage.html",
"destination" : "/:somepath*/zh/:somepage.html"
}, {
"source" : "/:somepath*/*/:somepage.html",
"destination" : "/:somepath*/en/:somepage.html"
}]
Note that the beginning path and the end page/path may vary. I'd appreciate any implementation suggestions you have.
Best,
Charles