Short answer: Apple requires the apple-app-site-association file over HTTPS "with a valid certificate and with no redirects". A redirect from the apex to www, from HTTP to HTTPS, or a firewall that blocks Apple's CDN all stop iOS reading the file. Serve it with a 200 at every domain in the entitlement.
What is happening
AASA delivery failure: Apple's CDN cannot fetch the apple-app-site-association file with a direct 200 response, so iOS has no rules for that domain.
Since iOS 14 and macOS 11, devices do not fetch the file from your server. Apple says they request it from "an Apple-managed content delivery network (CDN) dedicated to associated domains", which fetches from your server. So the CDN has to reach you.
- Apple's technote says a 301 or 302 on the file is "not supported".
- A 403 or 404 means "your site denied access".
- The file must be reachable "in all geographical locations, from any IP address", and the server "should accept all user agent requests".
- In a sysdiagnose,
swcutil_show.txtshowsSite/Fmwk Approvalfor each domain;approvedmeans the CDN fetched and matched the file.
Why does this happen?
Redirects are usually set up site-wide and catch the /.well-known/ path by accident. Blocks come from security tools that treat Apple's fetcher as a bot.
- Apex to www:
example.comredirects towww.example.com, but the entitlement saysapplinks:example.com. - Trailing slash or extension rewrites that send the file to another URL.
- WAF or bot rules that challenge unknown user agents.
- Geo or IP allowlists that exclude the regions or ranges Apple's CDN uses.
- Wrong file name: uploading only
apple-app-site-association.json, which returns a 404 at the real URL.
How to confirm it
- Run
curl -v https://example.com/.well-known/apple-app-site-association. Look forHTTP/2 200with noLocationheader. - Repeat for every domain in the entitlement, including
wwwand other subdomains. - Test the user agent policy with Apple's suggested check:
curl -A "MyAgent-Bot/*" https://example.com/.well-known/apple-app-site-association. - Optionally, check what Apple's CDN holds with
curl -i https://app-site-association.cdn-apple.com/a/v1/example.com. TheApple-Fromheader shows the origin URL it fetched. This CDN URL is not on an Apple documentation page.
How to fix it
- Exclude
/.well-known/apple-app-site-associationfrom site-wide redirect rules. - Serve the file directly on each host in the entitlement. A file on
example.comdoes not coverapplinks:www.example.com. - Name the file
apple-app-site-associationwith no extension. - Allow all IPs, regions and user agents on
/.well-known/in your WAF, CDN and bot settings. - Use a valid, trusted certificate.
- Reinstall the app on a test device, or wait for the CDN to refetch. Apple says it requests the file within 24 hours.
An nginx example that serves the file without rewrites:
location = /.well-known/apple-app-site-association {
default_type application/json;
try_files /.well-known/apple-app-site-association =404;
}
The Android equivalent is covered in assetlinks redirect. Once the file is reachable, confirm its content with sudo swcutil verify, and if old rules linger, see AASA changes not picked up. Repeat curl -I https://example.com/.well-known/apple-app-site-association for each domain.