Some background first, I'm trying to follow the directions here:
to get universal links working with my website for iOS devices. My wordpress site is in a shared hosting environment, therefore I do NOT have access to the server or any root files. I placed the file at the root of my site (httpdocs) and when I navigate to the page it does not load. In googling around, I found a stackoverflow post stating you had to config the server to let it know to serve up that file with a content type of "application/pkcs7-mime" (Config apple-app-site-association file with wordpress). As mentioned I do not have access to that.
I have a subdomain which is a microsoft web api project that I am very familiar with. I made an endpoint for "apple-app-site-association" and dynamically built the json response in code and set the content type and returned it. This ended up working and Apple detects it and everything. This is interesting as I do NOT need a file on my server as I generate it on the fly, and I don't need to change anything server wise.
The issue however is I need the main site domain to be the universal link, not the windows subdomain. The main site is wordpress. I'm thinking if may be possible to do the same thing in wordpress where I navigate to mydomain.com/apple-app-site-association and I generate the json and content-type on the fly and serve it up.
I've never done any coding with wordpress and don't even know where to start.
If possible I would like clear direction in the following:
- Making mydomain.com/apple-app-site-association lead to a custom function or page that serves up json.
- Have code that makes the json get served up dynamically.
- Have code that sets the content-type of the response to "application/pkcs7-mime".
Of course if someone knows how to solve the file not being served no a shared server without this method, I'm open to that as well. From what I can see, this may be the only way assuming this can be done.