简体   繁体   English

如何将apple-app-site-association的content / mime类型设置为application / json

[英]How to set content / mime type of apple-app-site-association as application/json

I am trying to setup universal app links for my app and am trying to upload the apple-app-site-association to the server at "/" and "/.well-known " locations but when I navigate to it I get a 404 error. 我正在尝试为我的应用设置通用应用程序链接,并尝试将apple-app-site-association上传到服务器“/”和“/.well-known”位置但是当我导航到它时,我得到了404错误。

The mime type is not application/json when I try to create one it always reverts back to type text and not application/json. 当我尝试创建一个mime类型时,它不是application / json,它总是恢复为键入文本而不是application / json。

I do not have access to Virtual Hosts/Apache Settings on Plesk for the server nor do I have access to the etc/sites-available to set content-type of the file.This is my reference https://gist.github.com/anhar/6d50c023f442fb2437e1#modifying-the-content-type . 我没有访问Plesk上的虚拟主机/ Apache设置服务器,也没有访问etc / sites-可用于设置文件的内容类型。这是我的参考https://gist.github.com / anhar / 6d50c023f442fb2437e1#modification-the-content-type

The contents of my file are 我的文件的内容是

{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "XXXXX.com.domain.appname",
                "paths": [
                    "*"
                ]
            }
        ]
    }
}

Please help. 请帮忙。

The server provided by the client is IIS so I had to upload a json file apple-app-site-association.json, and put in a rewrite rule in web.config file ,found at root, 客户端提供的服务器是IIS,因此我必须上传一个json文件apple-app-site-association.json,并在web.config文件中输入重写规则,在root中找到,

<rewrite>
        <rules>
            <rule name="apple_json_file">
                <match url="^apple-app-site-association" />
                <action type="Rewrite" url="apple-app-site-association.json" />

            </rule>
        </rules>
    </rewrite>

Did the trick for me. 对我有把戏。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Nginx/Rails 上为 apple-app-site-association 文件设置正确的内容类型 - How to set correct content-type for apple-app-site-association file on Nginx/Rails 如何在 ReactJS 中的 /apple-app-site-association 页面上提供 apple-app-site-association 文件 - How to serve apple-app-site-association file on /apple-app-site-association page in ReactJS apple-app-site-association JSON 没有出现? - apple-app-site-association JSON not showing up? >= 400 错误代码与 apple-app-site-association json 文件 - >= 400 error code with apple-app-site-association json file Apple-app-site-association 文件未链接到应用程序 - Apple-app-site-association file not linking to application apple-app-site-association 从 azure 请求中作为应用程序/JSON 返回 - apple-app-site-association to return as application/JSON from a azure request 如何响应“apple-app-site-association”请求 - How to respond to `apple-app-site-association` requests apple-app-site-association文件的位置 - Location for apple-app-site-association file 在浏览器中解密apple-app-site-association - Decrypt apple-app-site-association in browser apple-app-site-association实现安全吗? - Is the apple-app-site-association implementation safe?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM