Firebase动态链接子域配置 [英] Firebase Dynamic Links subdomain config
问题描述
假设我有一个域example.com
.然后,我通过托管和cli创建了另一个网站,名为sub.example.com
.
Let's say I have a domain example.com
. And I created a second website through hosting and cli as sub.example.com
.
{
"hosting": [
{
"target": "app",
"public": "public",
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
{
"target": "promos",
"public": "public",
"appAssociation": "AUTO",
"rewrites": [
{
"source": "**",
"dynamicLinks": true
}
]
}
]
}
现在,当我去为sub.example.com
创建动态链接而没有任何路径前缀时,它给我一个红旗,说:
Now when I go to create Dynamic Link for sub.example.com
without any path prefix, it gives me a red flag saying:
It looks like you already have content served on this path. Specify a different path prefix to avoid conflicts with existing content.
- 我在做什么错了?
- 此外,如果此子域仅用于链接,我还必须放置
public
字段吗?我不想显示任何内容,只是链接...
- What am I doing wrong?
- Also, if this subdomain is only for links, I still have to put
public
field? I don't want to show anything on it, just links...
推荐答案
我通过添加(或忽略)动态链接子域的公用文件夹来解决此问题.
I fixed it by adding (or rather ignoring) the public folder for the dynamic links subdomain.
"ignore": [
"*"
],
我看到了这篇文章: https://github.com/firebase/firebase- tools/issues/566 ,有人问类似的功能问题,答案是删除dist/index.html
.但是由于我的实际站点依赖于此,所以我尝试不理会它,并且似乎可以正常工作.
I saw this post: https://github.com/firebase/firebase-tools/issues/566 and someone asked similar question for functions and the answer was to delete dist/index.html
. But since my actual site depends on it, I tried just ignoring it and it seems to work.
这篇关于Firebase动态链接子域配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!