Workaround : How to host root files (.txt, .md, .json) on Wix using Cloudflare Workers

Hi everyone,

If you’re using Wix, you’ve probably hit a brick wall trying to upload technical files to your root directory (like specialized files like, manifest, guidelines or readme.llm.md for AI agents). Wix simply doesn’t allow access to the root folder.

I found a clean, professional workaround using Cloudflare Workers and KV Storage. This allows you to serve any file from your domain without migrating away from Wix.

Please note that your domain’s DNS must be pointed to Cloudflare for this setup to function

The Concept: Cloudflare acts as a “smart router.” When a request comes in for a specific file, the Worker intercepts it and serves the content from a Cloudflare database (KV) instead of Wix. For everything else, it lets your Wix site load normally.

The Workflow:

  1. Cloudflare KV (The Storage): Create a KV Namespace. This is your virtual folder. Add your files here (e.g., Key: readme.llm.md / Value: your file content).

  2. The Worker (The Logic): Deploy a simple Worker script that checks the URL path:

    • If the path matches a key in your KV storage, it serves that content with the correct headers (Markdown, JSON, etc.).

    • If not, it fetches your Wix site as usual.

  3. Binding & Routes: Bind your KV Namespace to your Worker in “Settings > Variables.”

    • Set a Route in “Settings > Triggers” for www.yourdomain.com/*. Dont forget *, it’s important.

Why this is a game-changer:

  • Bypass Wix limitations: Host any file extension at the root of your domain.

  • AI & SEO Ready: Perfect for serving clean data to AI crawlers (GPT, Claude) or ad networks.

  • Zero Downtime: Your Wix site remains completely untouched and functional.

Check out my live version here: https://www.moncodekarma.com/readme.llm.md

Hereafter an exemple of the the JavaScript code if anyone is interested!

export default {
async fetch(request, env, ctx) {
const url = new URL(request.url);
const path = url.pathname;

// IMPORTANT: "MY_STORAGE" must match the Variable Name in your Worker Settings
const content = await env.MY_STORAGE.get(path) || await env.MY_STORAGE.get(path.replace("/", ""));

if (content !== null) {
  let type = "text/plain; charset=utf-8";
  if (path.endsWith(".md")) type = "text/markdown; charset=utf-8";
  if (path.endsWith(".json")) type = "application/json";

  return new Response(content, {
    headers: { 
      "Content-Type": type,
      "Access-Control-Allow-Origin": "*" 
    }
  });
}

return fetch(request);

}
};