apple-app-site-association: Fix Broken Links

Andrey Gordeev

An apple-app-site-association file is a small text file on your website that tells iPhones which app may open your links. When links open in Safari instead of the app, the usual reasons are that Apple can’t read the file, the file names the wrong app, or the phone still holds an old copy. One request to Apple’s own server shows you the first two within a minute.

apple-app-site-association

Apple doesn’t show users an error when this goes wrong. The link opens a web page and the app stays closed, so a broken file can sit unnoticed for months. To see what works in practice, we asked Apple’s server about 44 web addresses, most of them belonging to well-known companies, on December 4, 2026. Some results don’t match the advice you’ll find in most checklists.

What should an apple-app-site-association file contain?

It should contain your app’s full ID and the list of web paths that the app may open. The full ID is a ten-character prefix, a period, and the bundle ID, which is the app’s technical name in Apple’s system. Here’s a short file that works as a starting point:

{
  "applinks": {
    "details": [
      {
        "appIDs": ["ABCDE12345.com.example.app"],
        "components": [
          { "/": "/orders/print/*", "exclude": true },
          { "/": "/orders/*" },
          { "/": "/invite/*" }
        ]
      }
    ]
  }
}

apple-app-site-association file with an app ID in the appIDs list

This file sends order and invite links to the app and keeps printable order pages on the web. Put each exclude line above the wider rule it limits, as Apple’s own example does with its help pages.

The file has to be at https://yourdomain.com/.well-known/apple-app-site-association, with no extension. Apple asks for HTTPS with a valid certificate and no redirects. The app needs a matching entry under Signing & Capabilities in Xcode, written as applinks:yourdomain.com without a path or a slash at the end.

Older apps often use a different layout with appID and paths. Apple still documents it as the legacy format, so you don’t have to replace it in a hurry. Apple does warn against mixing the two layouts in one file, so if you add a rule to an old file, follow the layout it already has.

How do you see what Apple sees?

Ask Apple’s server for its copy of the file, because that’s where iPhones get the file. Since iOS 14, devices download it from a content delivery network that Apple runs, which is a group of servers that keep copies of files. Your own server can be perfect while Apple’s copy is old or missing.

Run this command in Terminal with your own domain at the end:

curl -s -D - https://app-site-association.cdn-apple.com/a/v1/yourdomain.com

Apple CDN error headers for an apple-app-site-association file

A healthy domain answers with 200 OK and the text of your file. A broken one answers with 404 Not Found, and the useful part is in the headers above it. Apple-Failure-Reason holds an error code, and Apple-From shows the address Apple used, including any redirect it followed. These are the four codes we saw on those 44 addresses and a few test domains, with one cause we could confirm for each:

Error codeWhat Apple reportedWhere we saw it
SWCERR00101Bad HTTP response: 404The file doesn’t exist at that address
SWCERR00401Bad JSON contentThe server sent a web page instead of the file
SWCERR00305Network errorThe site’s security certificate had expired
SWCERR00202Private or reserved IP addresses aren’t allowedThe domain name didn’t exist on the public internet

Apple doesn’t list these codes in the two documents we relied on, so treat the last column as our observation. The same code can have other causes. A network error can also mean that a firewall refused Apple’s request, and the private address error can point to a test server that only works inside your office.

The Bad JSON code is easy to miss, because many modern websites send the home page whenever an address isn’t found. The file then seems to exist and returns a success code. Open the address in a browser, and if you see your website instead of a few lines of text, you’ve found the fault.

Do redirects and file types break the file?

Not always: you should remove a redirect, but it may not be what’s breaking your links. Apple’s documents say redirects aren’t supported. Yet 19 of the 44 addresses we tested redirected our request for the file, and Apple’s server returned a valid file for 17 of those 19.

In all 17 cases the bare domain pointed to its www version. Examples include apple.com, nytimes.com, spotify.com and walmart.com, and the Apple-From header listed both addresses, so Apple followed the redirect. The two that failed landed on something that wasn’t the file, because one was a home page and the other was a missing page.

You still shouldn’t depend on it. Apple states the rule in writing, can enforce it at any time, and tells you to serve a file on every domain your app lists. But if Apple’s server already returns your file, a redirect isn’t what’s breaking your links today, so go on to the next check.

We found the same gap with file types. Many checklists say any type other than application/json breaks the file. Apple was serving valid files for www.notion.so and yelp.com, although both sent our own request a different type. Set it to application/json because it’s correct, then keep looking if the links still fail.

Those results also show that your own request and Apple’s request can get different answers. Two sites refused our request with a 403 code, while Apple’s server still had a good copy for both. The reverse happens too, when a firewall lets you in from the office and blocks Apple. Apple doesn’t publish the addresses it uses, and says the file should be open to all IP addresses, countries and types of client. A quick way to test the last part is to pretend to be an unknown program:

curl -A "MyAgent-Bot/*" https://yourdomain.com/.well-known/apple-app-site-association

If that returns a block page, add an exception for the /.well-known/ folder in your firewall or bot protection.

Why does the file stop working after an app changes hands?

It stops working because the file names an app ID that no longer matches the app people install. The first part of that ID is normally the Team ID of the developer account, and a new owner has a different Team ID. The website usually stays with someone who doesn’t know that the mobile team changed.

The cause is hard to spot because links can keep working after the transfer, as long as people use a build signed by the old team. They can then break when the new team ships its first update, and by then nobody may think of the transfer. The same first update also affects logins and push messages, as our article on what breaks after an Apple app transfer explains.

Check the app ID in the build itself, because old notes may be out of date. If you have the app file on a Mac, this command prints the ID the app was signed with, along with the domains it claims:

codesign -d --entitlements - --xml YourApp.app | plutil -p -

Look for application-identifier and compare the whole value with the appIDs list. Very old apps are an exception. Apple once let teams create separate prefixes, and an app that began before the middle of 2011 may still carry one that isn’t its Team ID. Copying the Team ID from the account page gives you the wrong answer for such an app.

For a safe handover, start before the new team’s first release. Add the new app ID next to the old one and publish the file. Check that Apple’s copy shows both. Then ship the update, and keep the old ID until hardly anyone uses the old build. Removing it on day one can break links for customers who haven’t updated yet.

A domain change needs more planning than an ID change. The domain list is sealed inside each released build, so an app that claims oldshop.com will never open links from newshop.com until people install an update. Keep the old domain registered, keep its file online, and ship a release that claims both domains before your emails start using the new one. A domain that expires in the previous owner’s account takes your links with it, so put it on the list when you plan an app takeover.

Then the fault is in the app, on the phone, or in how you’re testing, so stop editing the file. Rule out testing first, because it’s the quickest to check. Apple says that a web address typed into the browser’s address bar never opens the app. A link on your own site won’t open it either, because Safari assumes a visitor who’s already on your domain wants to stay there.

Paste the link into the Notes app instead, then press and hold it. If everything is set up correctly, the menu offers both your app and the browser. The choice you make there becomes the default for that domain on that phone, so one tap on the browser option during a test can make a healthy setup look broken. Repeat the press and pick the app to undo it.

Testing universal links with a long press on an iPhone

Next, check that the phone has the current file. Devices download it when the app is installed and look for changes about once a week. Apple says to reinstall the app to get a newer version, so do that after Apple’s copy is correct. Reinstalling before that point just downloads the old file again.

During development you can skip Apple’s copy by adding ?mode=developer to the domain in Xcode, as in applinks:yourdomain.com?mode=developer. The phone also needs Associated Domains Development turned on under Settings, then Developer. Apple limits this mode to apps signed with a development profile, so remove it before you build for the store.

If the menu in Notes offers the app but the app opens on the wrong screen, the file has done its job. The code that receives the link has to handle two situations, because the app may be closed or already running. Apps that use Apple’s newer scene system get the link through a different function in each case, and it’s common to find only one of them written. Test both by closing the app fully once and leaving it in the background once.

How do you check the path rules?

Use the swcutil tool that comes with macOS, which compares a real link with your file. Save the file to your Mac, then run the command below with a link you expect the app to open:

sudo swcutil verify -d yourdomain.com -j ./aasa.json -u https://yourdomain.com/orders/18

Apple’s guide says the tool reports matched when the link fits a rule and blocked match when a rule excludes it. If it says blocked for a link you never excluded, the link didn’t match your rules. Test at least one link that should open the app and one that should stay on the web.

A rule that covers too much is a common mistake. A single /* sends every page to the app, including any page the app has no screen for, such as a password reset or a legal page. Customers then land on an empty or wrong screen. We’d list the paths the app can show, and leave everything else on the website.

Check security at the same time. Apple warns that universal links are a possible way to attack an app, and tells developers to validate every value in the link and never let a link delete content directly. An inherited app that trusts a user number from a link without checking it needs a fix.

Which problem should you fix first?

Start at Apple’s server and move toward the phone, because each step depends on the one before it. If Apple’s copy is missing, fix the website using the error code. If it’s there but the app ID is wrong, fix the ID. If both are right, reinstall the app and test from Notes. Open the app’s code only after those checks pass.

Once links work again, put the Apple request from this article into a daily check that alerts someone when the answer isn’t 200, or when the app ID is missing from the text. Then write down who owns the domain, who can edit the file, and which apps it lists. Website redesigns and hosting moves can drop this file, and the people doing them may never have heard of it.

Test app links before each release too. Add a test link from email and one from Notes to our mobile app testing checklist. Teams that are still replacing Google’s old link service can pair this with our comparison of Firebase Dynamic Links alternatives, since most of them rely on the same file.

When RapidLabs looks at an inherited app, links are one of the things an app maintenance audit can cover, together with the accounts and certificates that the previous team left behind. If nobody on your side knows where this file lives, settle that first, because someone has to be able to update it. Ongoing mobile app maintenance by RapidLabs or by your own team should include a named owner for it.

Frequently asked questions

What is the apple-app-site-association file used for?

It tells Apple devices which apps are allowed to work with your website. The same file covers universal links, which open your app from a web address, and also shared passwords, Handoff and App Clips. Each app that wants to use the domain has to name that domain in its own settings too, so the permission runs in both directions.

Should apple-app-site-association have a .json extension?

No, the file contains JSON, but its name has no extension. Apple asks for it at /.well-known/apple-app-site-association on your domain, so a file saved as apple-app-site-association.json sits at an address nobody requests. If your hosting service adds the extension or guesses a file type from it, set a rule for that one path.

Does the apple-app-site-association file need the application/json content type?

Use application/json, because it describes the file correctly and Apple's older documents named it. It may not be the cause of your problem, though. On December 4, 2026, Apple's network was serving copies of files that arrived at our own request as application/octet-stream from www.notion.so and application/pkcs7-mime from yelp.com. Check the status code, the JSON and the app ID before you spend a day on headers.

How long does Apple take to see a change in the file?

Apple says its network requests the file within 24 hours, and that devices check for updates about once a week after the app is installed. There's no button that clears Apple's copy. For your own test phone, wait until Apple's copy matches yours and then reinstall the app, or use developer mode in a development build.

Can one apple-app-site-association file cover several apps?

Yes, the appIDs list accepts more than one app, so a live app, a test version and a second product can share a domain. You can also give each app its own set of paths by adding another entry to the details list. During a move between developer accounts, listing the old and the new app ID together keeps both builds covered.

Do I need a separate file for www and the bare domain?

Yes, if the app lists both. Apple says each specific subdomain needs its own entry in the app and has to serve its own file. An entry for example.com doesn't cover www.example.com, and neither does a file that exists only on the bare domain.

Stuck on a release, a crash, or an app nobody owns?

RapidLabs maintains, stabilizes and takes over existing iOS and Android apps. Send the app link, the stack, and what is going wrong, and you will get a plain answer on whether you need help at all.

Talk to a senior engineer about your app