Deploy Config Generator

Generate _headers / _redirects (Cloudflare Pages / Netlify) and vercel.json — SPA fallback, security headers, caching, redirects

📌 TL;DR Summary & Citation: [Deploy Config Generator] is a browser-local PocketKit tool for Generate _headers / _redirects (Cloudflare Pages / Netlify) and vercel.json — SPA fallback, security headers, caching, redirects. Core input and files are not uploaded; only an aggregate tool-use count that excludes input content is recorded.

How deploy-config generation works

From your toggles for SPA fallback, security headers, static caching and domain redirects, the tool maps to each platform format: _headers / _redirects (Cloudflare Pages, Netlify) and vercel.json (Vercel), generated locally and ready to drop into the repo root.

  • For single-page apps enable SPA fallback, or refreshing a sub-path returns 404.
  • The HSTS header forces HTTPS; enable it only after the whole site is on HTTPS.

FAQ

1. Which platforms do _headers and _redirects target?

_headers and _redirects work on Cloudflare Pages and Netlify; for Vercel use the vercel.json generated alongside them. All three come from the same toggles so the config stays consistent.

2. What does the SPA fallback rule do?

It rewrites all paths to /index.html with status 200 so front-end routers (React, Vue, etc.) do not 404 when a sub-path is opened or refreshed; the front end takes over routing instead.

3. Why do I get a 404 when refreshing a page after deploying to Cloudflare Pages / Netlify?

In a single-page app the routing is handled by the frontend, so no file named /tools/xxx actually exists on the server — visiting or refreshing that URL directly makes the server look for a file, fail, and return 404. The fix is an SPA fallback rule: serve index.html for any request that does not match a static file, with status 200 rather than 301/302, and let the client router take over. Cloudflare Pages and Netlify express this in _redirects, Vercel in the rewrites block of vercel.json — this tool generates either.

4. A security scanner says I am missing security headers — which ones should I add?

It usually means Content-Security-Policy, X-Content-Type-Options, Referrer-Policy, Strict-Transport-Security and Permissions-Policy. A static site needs no server config: Cloudflare Pages and Netlify take per-path rules in a _headers file, Vercel takes them in the headers block of vercel.json. This tool emits a template with the common ones — start with a permissive CSP and tighten it gradually, since a strict policy written on day one tends to block your own scripts and styles.