简体   繁体   English

>= 400 错误代码与 apple-app-site-association json 文件

[英]>= 400 error code with apple-app-site-association json file

As many others I am trying to implement universal links into my app.和其他许多人一样,我正在尝试在我的应用程序中实现通用链接。

I am using one.com as my webhotel provider, and have configured an apple-app-site-association json file without the json file ending.我正在使用 one.com 作为我的网络酒店提供商,并配置了一个没有 json 文件结尾的 apple-app-site-association json 文件。

Initially, I had troubles with strange characters appearing and the infamous content/type fault.最初,我遇到了奇怪的字符出现和臭名昭著的内容/类型错误的麻烦。 I added this snippet to my .htaccess file as follows that solved that issue:我将此代码段添加到我的 .htaccess 文件中,如下所示解决了该问题:

<Files "apple-app-site-association">
ForceType 'application/json'
</Files>

Below is the entire .htaccess code:以下是完整的 .htaccess 代码:

# Generated by One.com Website Builder
# Begin

<Files "apple-app-site-association">
ForceType 'application/json'
</Files>

RewriteEngine on

# Enforce SSL
# Handle non-www URLs
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^studievenn\.no [NC]
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Handle www URLs
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.studievenn\.no [NC]
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Handle URLs without .html extension
RewriteCond %{REQUEST_METHOD} ^(GET) [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI}.html -f
RewriteRule ^(.*) $1.html [L]

# End
# Generated by One.com Website Builder

Here is the aasa validator response这是aasa 验证器响应

在此处输入图像描述

I am primarily struggling with the我主要是在挣扎

Your server returned an error status code (>= 400)您的服务器返回错误状态代码 (>= 400)

Fault, but also the two latters errors.错,也是后两者的错误。

What could be the issue here?这里可能是什么问题?

I solved this problem by rather placing the apple-app-site-association file in a subdirectory: /.well-known/apple-app-site-association instead of my document root.我通过将 apple-app-site-association 文件放在子目录中解决了这个问题:/.well-known/apple-app-site-association 而不是我的文档根目录。 This fixed the issue.这解决了这个问题。

you should add this end of the.htaccess file it worked form me你应该在 .htaccess 文件的这一端添加它对我有用

Header set Content-type "application/pkcs7-mime" Header 设置内容类型“application/pkcs7-mime”

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM