You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何免费托管Apple App Site Association文件?Wix用户求解决方案

Got it, let's tackle this problem head-on—since Wix (and Squarespace) block uploading extensionless files and Apple insists on checking the root of your wixsite.com subdomain, here are three free, reliable workarounds that replace the old Cloudflare trick that stopped working:

Free Solutions for Apple App Site Association on Wix/Squarespace

Cloudflare's free Worker tier is more than enough to handle this use case, and it lets you intercept Apple's request directly at the DNS layer:

  • First, add your {YourUser}.wixsite.com domain to Cloudflare and make sure DNS records correctly point to Wix (Cloudflare needs to take over domain resolution).
  • Create a new Worker in the Cloudflare dashboard, then paste this code (replace the JSON content with your actual apple-app-site-association data):
addEventListener('fetch', event => {
  event.respondWith(handleRequest(event.request))
})

async function handleRequest(request) {
  const url = new URL(request.url)
  // Target the exact path Apple checks
  if (url.pathname === '/apple-app-site-association') {
    const appAssociationContent = JSON.stringify({
      "applinks": {
        "apps": [],
        "details": [
          {
            "appID": "YOUR_TEAM_ID.YOUR_BUNDLE_ID",
            "paths": ["*"] // Adjust paths as needed
          }
        ]
      }
    })
    return new Response(appAssociationContent, {
      headers: {
        'Content-Type': 'application/json',
        'Cache-Control': 'max-age=86400'
      }
    })
  }
  // Pass all other requests through to Wix normally
  return fetch(request)
}
  • Save the Worker, then create a route rule: {YourUser}.wixsite.com/apple-app-site-association → point it to your new Worker.
  • Test it: Visit https://{YourUser}.wixsite.com/apple-app-site-association—you should see your JSON content load directly.

2. GitHub Pages + Free Custom Domain

If you don't want to use Cloudflare, grab a free top-level domain (via services like Freenom) and set up GitHub Pages:

  • Create a public GitHub repo, add your extensionless apple-app-site-association file to the root.
  • Enable GitHub Pages for the repo, then bind your free custom domain to the Pages site.
  • In Apple's Developer Portal, update your associated domains to use applinks:your-free-domain.com instead of the Wix subdomain.
  • Point your custom domain to your Wix site via DNS settings, and ensure your-free-domain.com/apple-app-site-association loads correctly.

3. Squarespace-Specific JS Injection (Fallback)

For Squarespace users only—note this is a fallback since Apple's crawler might not execute JS, but it works for most cases:

  • Go to Squarespace Settings → Advanced → Code Injection.
  • Paste this code in the Header section (replace the URL with your hosted apple-app-site-association file, e.g., from GitHub Pages):
<script>
if (window.location.pathname === '/apple-app-site-association') {
  window.location.replace('https://your-hosted-url.com/apple-app-site-association');
}
</script>

内容的提问来源于stack exchange,提问作者Phedg1

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 08:40:15