通用链接 - 域有一些验证问题 [英] Universal link - The domain has some validation issue
问题描述
我正在使用通用链接打开应用程序,同时点按网址。我正在使用https服务器并完成了苹果的所有步骤( Apple Doc )。但苹果通用链接验证器显示以下错误,
Im working on universal link to open the application while tap the url. I am using https server and done all the steps from apple (Apple Doc). But the apple universal link validator show below error,
您的文件'内容类型'标题未找到或无法识别。
Your file's 'content-type' header was not found or was not recognized.
apple-app-site-association文件成功上传到服务器,文件如下所示,
The apple-app-site-association file successfully uploaded to server and the file be like below,
{
"applinks": {
"apps": [],
"details": [
{
"appID": "J2HBF9A3PZ.com.aors.speaku",
"paths": ["*","/"]
}
]
}
}
苹果表示不需要签署apple-app-site-association文件该域名是否具有https。
And apple said no need to sign the apple-app-site-association file whether the domain has https.
如果文件未签名,则其内容类型应为
application / json。否则,它应该是application / pkcs7-mime。
If the file is unsigned, it should have a Content-Type of application/json. Otherwise, it should be application/pkcs7-mime.
所以我的查询是如何提及内容类型(application / json)in这个apple-app-site-association文件???
So my query is how to mention the content type(application/json) in this apple-app-site-association file???
请帮我解决这个问题。我不知道它究竟是什么意思。
please help me on this. i don't know what it mean exactly.
推荐答案
我自己刚刚解决了这个问题。我必须登录到我的服务器并转到 apple-app-site-association
文件所在的目录。在这个目录中,我有一个 .htaccess
文件,我修改后包含以下几行:
I just solved this issue myself. I had to logon to my server and go to the directory where the apple-app-site-association
file was. In this directory, I had a .htaccess
file which I modified to include the following lines:
<Files "apple-app-site-association">
ForceType 'application/json'
</Files>
执行此操作后,验证服务停止抱怨 Content-Type
。
After doing this, the validation service stopped complaining about the Content-Type
.
注意:
- 如果您没有
.htaccess
文件,您只需创建一个。 - 我假设
.htaccess
文件应位于您网站目录的根目录中(您最有可能放置apple-app-site-association
file。
- If you don't have a
.htaccess
file, you can just create one. - I presume the
.htaccess
file should be in the root of your site directory (which is where you would most likely have placed yourapple-app-site-association
file.
这篇关于通用链接 - 域有一些验证问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!