I want to use Firebase Hosting to host an angular application and I need to create a redirection to some old files in another URL.
According with the Firebase Documentation you can do basic redirections
"redirects": [ {
"source" : "/foo",
"destination" : "/bar",
"type" : 301
}, {
"source" : "/firebase/*",
"destination" : "https://www.firebase.com",
"type" : 302
} ]
But I need a wildcard redirection
"redirects": [ {
"source" : "/config/*",
"destination" : "//oldsiteurl/config/[match-request]",
"type" : 302
}]
So, basically I need that myapp.firebase.com/config/some.json
redirects to //oldsiteurl/config/some.json
. I have a lot of json files so I do not want to match file by file.
Did you know if this is possible?
Thanks!
Go to Firebase Console and select Hosting from the menu of the left. You will see the deployed project with a list of your historical actions like Deployed , disabled , etc. Only after you have disabled the site, the "three vertical dots" menu will be available for you to choose the action to delete the deployment.
Select the project you want to use for a different environment, and then give it an alias. The alias can really be whatever you want, but it's common to use aliases like “development”, “staging”, or “production”. Once you've created a new alias, it will be set as the current environment for deployment.
Firebase automatically creates your firebase. json file at the root of your project directory when you run the firebase init command.
For people landing on this page, it is now possible to have wildcards in the URLs:
Sometimes it is desirable to capture parts of the source URL of a redirect and re-use them in the destination. You can do this using a
:
prefix to identify the segment and an optional*
after the name to indicate that it should capture the rest of the URL
(source)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With