HOSTING & DELIVERY GUIDE · SKU.md v1.0.0
Hosting /sku.md: HTTP headers, redirects, and exact 404 rules
Configure strict HTTP 200 delivery, UTF-8 Markdown headers, clean 404 boundaries, and compatible alternate links on CDNs, web servers, and hosted storefronts.
Updated
Required HTTP 200 status, MIME headers, and UTF-8 rules
Published validation checks the live HTTP response before parsing Markdown syntax. For /sku.md and every linked product knowledge document, the final response must return exact HTTP 200 with strict UTF-8 bytes and a media type of text/markdown or text/plain.
Set Content-Type: text/markdown; charset=utf-8 wherever your host allows custom headers. If a server includes a charset parameter, only utf-8 (case-insensitive) passes; declaring iso-8859-1 or streaming invalid UTF-8 byte sequences triggers published_contract_failed. Adding X-Content-Type-Options: nosniff prevents MIME sniffing, while a short Cache-Control: public, max-age=300 keeps edge caches fresh after updates.
When a catalog links to a Product knowledge Sitemap XML file instead of a Markdown product file, that XML response must return application/xml, text/xml, or application/sitemap+xml so the consumer routes it to XML parsing instead of Markdown validation.
| Resource kind | Required status | Accepted Content-Type | Byte & encoding rule |
|---|---|---|---|
| Catalog entry point (/sku.md) | Exact HTTP 200 (0 redirects for strict root) | text/markdown; charset=utf-8 (or text/plain with UTF-8) | Valid UTF-8, max 65,536 bytes (64 KiB), max 8,192 bytes per physical line |
| Product knowledge document (*.sku.md) | Exact HTTP 200 (same-origin redirects only) | text/markdown; charset=utf-8 (or text/plain with UTF-8) | Valid UTF-8, max 65,536 bytes (64 KiB), exact Catalog: backlink |
| Product knowledge Sitemap (XML) | Exact HTTP 200 | application/xml, text/xml, or application/sitemap+xml | Valid UTF-8 XML, max 52,428,800 bytes and 50,000 entries, no DTD/entities |
Why redirects and SPA soft-404 HTML fallbacks break validation
Strict root candidates serve /sku.md directly at HTTP 200 with zero redirects (redirect_count: 0). Redirects on /sku.md break strict delivery and also disable compatible homepage discovery, because a consumer is only allowed to inspect homepage <link rel="alternate"> declarations after /sku.md returns an exact HTTP 404 with zero redirects.
Single-page application (SPA) catch-all rewrites (/* /index.html 200) and themed storefront error pages that return HTTP 200 with Content-Type: text/html create a soft 404. A soft 404 on /sku.md fails published_contract_failed immediately on media type (text/html is rejected) and prevents compatible discovery from checking / because HTTP status 200 is not 404.
Similarly, HTTP 403, 429, 5xx, or timeouts are never treated as absence (404). Temporary 429/5xx or DNS uncertainty leaves published validation incomplete, while 403 fails published conformance outright.
- Never rewrite /sku.md or *.sku.md to /index.html or an HTML error shell with HTTP 200.
- Do not redirect https://shop.example/sku.md to /catalog.md or /en/sku.md; if /sku.md cannot be served directly, ensure /sku.md returns exact HTTP 404 and advertise /catalog.md on the homepage.
- Keep any allowed Product knowledge resource redirects same-origin HTTPS within at most 3 hops and free of ? or # delimiters on catalog targets.
Strict root /sku.md vs compatible HTML link alternate
SKU.md 1.0.0 defines two discovery tiers so merchants without root file control can still publish a valid catalog without relaxing /sku.md verification:
For strict root delivery, publish directly at https://your-domain.com/sku.md. For compatible discovery, return exact HTTP 404 (with zero redirects) on /sku.md and place one unambiguous <link rel="alternate" type="text/markdown" title="SKU.md" href="/catalog.md"> tag on the same-origin HTTPS homepage. The title="SKU.md" attribute is required by the discovery parser, and multiple conflicting alternate tags or ?/# query/fragment URLs are rejected.
Individual canonical product HTML pages may also include <link rel="alternate" type="text/markdown" href="..."> as a convenience hint, but that page-level link never replaces discovery from the root catalog and its ## Product knowledge links.
Compatible homepage declaration and optional product-page alternate tag
<!-- Compatible catalog declaration in homepage <head> (used only after exact 404 at /sku.md) --><link rel="alternate" type="text/markdown" title="SKU.md" href="/catalog.md"> <!-- Optional convenience relation on a canonical product HTML page (does not replace /sku.md) --><link rel="alternate" type="text/markdown" href="https://www.example-outdoor.com/products/tent.sku.md">Compatible homepage discovery runs only when /sku.md returns exact HTTP 404 with zero redirects; title="SKU.md" is mandatory on the catalog alternate link.
Cloudflare Pages (_headers) and Cloudflare Workers edge routes
On static hosts like Cloudflare Pages, commit /sku.md directly into your public/ directory and configure public/_headers with explicit MIME and cache rules. This repository uses that exact _headers pattern to serve its own static resources.
If your storefront backend (such as a hosted ecommerce theme) does not let you create a static /sku.md file at the origin root, place a lightweight Cloudflare Worker route in front of /sku.md and *.sku.md on the same origin. The Worker serves exact UTF-8 bytes with 200 OK and text/markdown; charset=utf-8 while forwarding every other storefront request untouched.
Cloudflare Pages _headers and Cloudflare Worker edge route
# Cloudflare Pages / Netlify _headers/sku.md Content-Type: text/markdown; charset=utf-8 Cache-Control: public, max-age=300 X-Content-Type-Options: nosniff /products/*.sku.md Content-Type: text/markdown; charset=utf-8 Cache-Control: public, max-age=300 X-Content-Type-Options: nosniff // --- Or serve from a same-origin Cloudflare Worker route ---export default { async fetch(request: Request): Promise<Response> { const url = new URL(request.url); if (url.pathname === "/sku.md" && !url.search) { const body = [ "# Example Outdoor Gear", "> Lightweight outdoor equipment for hikers.", "", "SKU.md: [1.0.0](https://sku.md/spec/1.0.0/)", "Website: [example-outdoor.com](https://www.example-outdoor.com/)", "", "## Catalog", "- [All products](https://www.example-outdoor.com/collections/all)", "", ].join("\n"); return new Response(body, { status: 200, headers: { "content-type": "text/markdown; charset=utf-8", "cache-control": "public, max-age=300", "x-content-type-options": "nosniff", }, }); } return fetch(request); },};Avoid placing a forced /* /index.html 200 SPA rule ahead of static .md files in _redirects; let missing /sku.md return true 404 if using compatible discovery.
Nginx, Vercel, Netlify, and static web servers
On Nginx, static servers, Vercel, and Netlify, the most important rule is pairing explicit Content-Type: text/markdown; charset=utf-8 headers with an exact =404 fallback (or negative-lookahead SPA rewrite) so missing Markdown files never fall back to index.html.
- Nginx: use an exact location = /sku.md block with default_type text/markdown; charset utf-8; try_files /sku.md =404; so Nginx never routes /sku.md into a PHP front controller or @spa fallback.
- Vercel: configure headers in vercel.json for /sku.md and /(.*)\.sku\.md, and guard any catch-all SPA rewrite with a negative lookahead excluding sku.md and *.sku.md.
- Netlify: place the _headers block above in your publish directory and omit /sku.md from any /* /index.html 200 rule in _redirects.
Copy-ready Nginx server block and vercel.json header + rewrite guard
# Nginx: serve UTF-8 Markdown and return exact 404 when missinglocation = /sku.md { default_type text/markdown; charset utf-8; add_header Cache-Control "public, max-age=300" always; add_header X-Content-Type-Options "nosniff" always; try_files /sku.md =404;} location ~* \.sku\.md$ { default_type text/markdown; charset utf-8; add_header Cache-Control "public, max-age=300" always; add_header X-Content-Type-Options "nosniff" always; try_files $uri =404;} // vercel.json: explicit headers + exclude /sku.md from SPA rewrites{ "headers": [ { "source": "/sku.md", "headers": [ { "key": "Content-Type", "value": "text/markdown; charset=utf-8" }, { "key": "Cache-Control", "value": "public, max-age=300" }, { "key": "X-Content-Type-Options", "value": "nosniff" } ] }, { "source": "/(.*)\\.sku\\.md", "headers": [ { "key": "Content-Type", "value": "text/markdown; charset=utf-8" }, { "key": "X-Content-Type-Options", "value": "nosniff" } ] } ], "rewrites": [ { "source": "/((?!sku\\.md$|.*\\.sku\\.md$).*)", "destination": "/index.html" } ]}Both examples keep /sku.md and *.sku.md isolated from HTML SPA fallbacks and enforce UTF-8 text/markdown.
Delivery options on hosted commerce platforms
Hosted ecommerce storefronts differ in whether merchants control the bare root /sku.md path. Choose strict root delivery only when you can verify HTTP 200, text/markdown or text/plain UTF-8 headers, zero redirects, and exact 404 behavior on the live storefront origin.
| Platform | Root /sku.md boundary | Recommended strict route | Compatible fallback |
|---|---|---|---|
| Shopify | Managed theme root reserves /agents.md; App Proxy uses restricted prefixes. | Hydrogen custom storefront or same-origin Cloudflare edge route. | Test whether exact 404 + homepage <link rel="alternate"> is supported. |
| WooCommerce | Shared WordPress permalinks can fall back to theme 404 HTML if misconfigured. | Static /sku.md file, targeted add_rewrite_rule, or edge route. | Homepage <link rel="alternate" type="text/markdown" title="SKU.md">. |
| SHOPLINE | File Library + 301 redirect exposes files on CDN rather than strict bare root. | Merchant-controlled headless storefront or same-origin edge Worker. | Use exact 404 root check before relying on alternate discovery. |
| BigCommerce | Stencil theme routing cannot assign text/markdown at bare /sku.md directly. | Catalyst / headless storefront route or same-origin edge route. | Inject homepage <link rel="alternate"> via theme or Scripts API when /sku.md returns 404. |
Live header verification checklist before publishing
Always verify the live deployed URL after updating CDN headers or rewrite rules. Local document validation cannot inspect live HTTP headers or redirect behavior.
- Run curl -i --max-redirs 0 https://your-domain.com/sku.md and confirm the first response is HTTP/2 200 (not 301, 302, or 404 when strict).
- Check that content-type starts with text/markdown (or text/plain) and has charset=utf-8 when a charset is present.
- Verify the response body is plain UTF-8 Markdown with no injected HTML wrapper or BOM garbage.
- Run the Quick Start published URL checker (/quick-start/#published-url-checker) to record live published and graph evidence.
Inspect exact first-hop HTTP headers and body with curl
curl -i --max-redirs 0 https://www.example-outdoor.com/sku.md--max-redirs 0 exposes unexpected 301/302 redirects immediately before running online validation.
Platform guides and troubleshooting
Platform Overview
Compare strict root and compatible discovery models across store platforms.
Shopify Guide
Check Shopify /agents.md, App Proxy limits, and Hydrogen edge delivery.
WooCommerce Guide
Configure static files, WordPress rewrite rules, or edge routes for /sku.md.
SHOPLINE Guide
Compare SHOPLINE File Library redirects against strict headless or edge delivery.
BigCommerce Guide
Compare Stencil, Scripts API alternate links, Catalyst headless, and edge routes.
Quick Start & URL Checker
Verify your live /sku.md HTTP response with the read-only MCP checker.
Validation Errors Guide
Fix published_contract_failed, MIME mismatches, and all 8 v1.0.0 issue codes.