我使用火源动态链接将用户重定向到移动应用程序。
像https://example.com/mypath这样的链接可以工作,但我也想使用根url,即https://example.com
目前,它显示了错误:
无效动态链路 请求的URL (https://example.com/)必须是可解析和完整的DynamicLink。 如果您是此应用程序的开发人员,请确保您的动态链接域配置正确,并且此URL的路径组件有效。
当我尝试设置一个没有前缀的链接时,它会显示错误:
需要短URL

有办法设置根网址吗?
发布于 2021-01-11 21:20:19
另一种从根动态链接域设置重定向(而不使用javascript重定向的页面)的方法是将类似于此的重定向规则添加到firebase.json文件中:
"redirects": [ {
"source": "/",
"destination": "https://example.com/page-for-root-to-redirect-to",
"type": 301
} ]此规则将与动态链接重写规则一起存在,因此对于一个简单的设置,除了根之外的所有路径都被视为动态链接,您的firebase.json可能如下所示:
{
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [ {
"source": "/**",
"dynamicLinks": true
} ],
"redirects": [ {
"source": "/",
"destination": "https://example.com/page-for-root-to-redirect-to",
"type": 301
} ]
}
}若要访问和修改您的firebase.json文件,您必须使用firebase设置防火墙主机,如果您还没有:https://firebase.google.com/docs/hosting
本页详细介绍firebase.json文件以及如何使用重写和重定向规则:https://firebase.google.com/docs/hosting/full-config。
发布于 2020-05-25 14:16:16
如果您也使用Cloudflare,我的解决方案是向Firebase动态链接中添加一个子域,并使用页面规则将主url重定向到子域。
这样,您就可以将它设置为这样工作:
example.com/url -重定向到-> subdomain.example.com/url (并加载动态链接)example.com/ -重定向到->主站点或任何您想要的发布于 2020-05-19 18:04:31
我也有同样的问题。我想要做的是将根域转发到另一个URL。我所做的就是在那个域名上建立防火墙主机。然后,在index.html文件上,我编写了一个javascript重定向。
<script>
window.location = "https://www.example.com";
</script>如果您需要更多的帮助,请随时回复,我会帮助您。
https://stackoverflow.com/questions/58995371
复制相似问题