Universal link only on subdomain not on top level domain

In our iOS app we have added example.com in associated domains from the very beginning With no AASA file hosted at example.com domain

Now we need a subdomain app.example.com to be intercepted in our app, so for the same, we are thinking to host AASA at app.example.com and add app.example.com in associated domains too.

so my question is will hosting AASA at sub domain works? If yes, will it affect older apps where app.example.com is not handled.

In short we only want the links with app.example.com to be open in our app not the example.com links

Answered by Engineer in 823131022

@shivamprajapati @shivamprajapato to clarify:

https://developer.apple.com/documentation/technotes/tn3155-debugging-universal-links#Understand-applinks-configuration-and-rules

You’ll find this about domain and subdomains: Make sure your domains and AASA file paths match. To match a root domain and all subdomains with a wildcard, an AASA file should be hosted at: https://example.com/.well-known/apple-app-site-association This will only work with the root domain of applinks:example.com and subdomains that are matched with the wildcard applinks:*.example.com. This will not work with specific subdomains like applinks:www.example.com or applinks:foo.example.com.

To match a specific subdomain, an AASA file should be hosted at: https://www.example.com/.well-known/apple-app-site-association This will only work with applinks:www.example.com. Each specific subdomain in your applinks should have its own matching AASA file path. Based on the information provided, you will need to host two AASA file paths for the domain and the subdomain.

Hopefully this helps.

Rico


WWDR | DTS | Software Engineer

If you serve the file at the root of your subdomain and no redirects occur, it should be fine.

Actually I want to know that hosting AASA at app.example.com domain affect links https://example.com.

Will the links starting with https://example.com also start to come in apps? I do not want it. I only want the links starting with https://app.example.com to come in the app.

If you are hosting it in the root folder of your subdomain it shouldn't have an effect on your original domain.

@shivamprajapati @shivamprajapato to clarify:

https://developer.apple.com/documentation/technotes/tn3155-debugging-universal-links#Understand-applinks-configuration-and-rules

You’ll find this about domain and subdomains: Make sure your domains and AASA file paths match. To match a root domain and all subdomains with a wildcard, an AASA file should be hosted at: https://example.com/.well-known/apple-app-site-association This will only work with the root domain of applinks:example.com and subdomains that are matched with the wildcard applinks:*.example.com. This will not work with specific subdomains like applinks:www.example.com or applinks:foo.example.com.

To match a specific subdomain, an AASA file should be hosted at: https://www.example.com/.well-known/apple-app-site-association This will only work with applinks:www.example.com. Each specific subdomain in your applinks should have its own matching AASA file path. Based on the information provided, you will need to host two AASA file paths for the domain and the subdomain.

Hopefully this helps.

Rico


WWDR | DTS | Software Engineer

Universal link only on subdomain not on top level domain
 
 
Q