gpt4 book ai didi

Firebase 托管 - 通配符重定向

转载 作者:行者123 更新时间:2023-12-03 10:12:41 27 4
gpt4 key购买 nike

我想使用 Firebase 托管来托管一个 angular 应用程序,我需要创建一个重定向到另一个 URL 中的一些旧文件。

根据 Firebase 文档,您可以进行基本重定向

"redirects": [ {
"source" : "/foo",
"destination" : "/bar",
"type" : 301
}, {
"source" : "/firebase/*",
"destination" : "https://www.firebase.com",
"type" : 302
} ]

但我需要通配符重定向
"redirects": [ {
"source" : "/config/*",
"destination" : "//oldsiteurl/config/[match-request]",
"type" : 302
}]

所以,基本上我需要 myapp.firebase.com/config/some.json 重定向到 //oldsiteurl/config/some.json 。我有很多 json 文件,所以我不想逐个文件匹配。

你知道这是否可能吗?

谢谢!

最佳答案

对于登陆此页面的人,现在可以在 URL 中使用通配符:

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 )

关于Firebase 托管 - 通配符重定向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32511657/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com