You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

注册关联域时能否指定目录路径以适配apple-app-site-association部署

结论

不支持以applinks:smth.com/FrontDirectory的格式注册关联域,苹果关联域(Associated Domains)规则不允许在域名后追加自定义路径指定AASA(apple-app-site-association)文件的拉取地址,系统会固定从站点的两个标准路径拉取文件:

https://smth.com/apple-app-site-association
https://smth.com/.well-known/apple-app-site-association

可行替代方案

  • 方案1:服务端配置路径重写规则
    在你的站点Web服务(Nginx/Apache等)中配置内部重写,将两个标准路径的请求定向到你实际部署的/FrontDirectory/apple-app-site-association路径,注意必须是内部重写(返回200状态码),不能使用301/302外部跳转,苹果系统不会跟随AASA请求的跳转。
    以Nginx为例,配置参考:
    # 匹配.well-known下的AASA请求
    location = /.well-known/apple-app-site-association {
        alias /你的服务器实际文件存储路径/FrontDirectory/apple-app-site-association;
        add_header Content-Type application/json;
    }
    # 匹配根路径下的AASA请求
    location = /apple-app-site-association {
        alias /你的服务器实际文件存储路径/FrontDirectory/apple-app-site-association;
        add_header Content-Type application/json;
    }
    
  • 方案2:CDN层面配置路径改写
    如果你的站点接入了CDN,可以在CDN控制台配置路径改写规则,将两个标准AASA路径的请求转发到/FrontDirectory/apple-app-site-association,无需修改源站配置。

注意事项

  • AASA文件必须无后缀,文件名严格为apple-app-site-association,不能加.json等后缀
  • 文件返回的Content-Type响应头必须为application/json,否则系统会识别失败
  • 不要给AASA文件设置过长的缓存时间,避免文件更新后苹果侧长时间拉取不到新版本
  • 关联域注册时格式严格为applinks:smth.com,不要追加任何路径后缀

内容的提问来源于stack exchange,提问作者user17084171

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.01 05:54:03