在为 iOS 应用程序设置通用链接时,Apple 声明:
- Create an apple-app-site-association file that contains JSON data about the URLs that your app can handle.
- Upload the apple-app-site-association file to your HTTPS web server. You can place the file at the root of your server or in the .well-known subdirectory.
我们创建了一个没有扩展名的名为“apple-app-site-association”的文件,但如果导航到“http://ourdomain.com/apple-app-site-association”,我们会收到 404 文件未找到错误。
Apple 指定不向文件名添加 .json。
我们看到another SO overflow answer描述 IIS 的配置更改以提供不带扩展名的文件。但是,要从 GoDaddy 的 Linux 或 IIS 服务器正确提供此文件的诀窍是什么?
最佳答案
我能够通过在包含以下内容的根级别添加 .htaccess 文件来实现它:
<Files "apple-app-site-association">
ForceType application/json
</Files>
奇怪的是,如果我试图将 apple-app-site-association 和 .htaccess 文件放在 .well_known 目录中,我无法让它工作。
有了这个配置,这里的验证器https://branch.io/resources/universal-links/都是绿色的,链接本身也有效。
关于linux - 如何在 GoDaddy 的网络托管服务上提供没有扩展名的文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37830747/