How can I create and upload a apple-app-site-association file and JSON file inside a ".well-known" folder in Webflow?
TL;DR
- Create the JSON file locally with no extension, host it externally (e.g., Amazon S3), and ensure HTTPS support.
- In Webflow, navigate to project settings, set up a 301 redirect from
/.well-known/apple-app-site-associationto the external URL, and publish the site to apply changes.
To properly upload an apple-app-site-association file and a JSON file to Webflow, you need to use a redirect method since direct access to the root directory or a .well-known folder is restricted on Webflow hosting.
1. Create the Files Locally
- Generate the JSON data for your
apple-app-site-associationfile following Apple's specifications. - Ensure the file is named
apple-app-site-associationwithout a file extension.
2. Host the Files Externally
- Use an external hosting service like Amazon S3 or GitHub Pages to host your files.
- Ensure your host supports serving files over HTTPS.
3. Set Up Webflow Redirects
- Log in to your Webflow account and navigate to the Project Settings.
- Go to the Hosting tab.
- Scroll to the 301 Redirects section.
- For the Redirect Path, enter:
/.well-known/apple-app-site-association. - For the Redirect URL, enter the full URL where your
apple-app-site-associationis hosted (e.g.,https://your-external-host.com/apple-app-site-association). - Save the settings to apply the redirect.
4. Publish Your Project
- Publish your site to apply the changes.
- Double-check by navigating to
https://your-site.com/.well-known/apple-app-site-associationand ensure it properly redirects and serves the file.
Summary
You can host your apple-app-site-association and other JSON files externally, then set up 301 redirects in Webflow to serve these files through a .well-known path. This allows Webflow to integrate such files for services like Apple's Universal Links.