Kubernetes Manifest Studio
Generate Deployment, Service, and Ingress YAML with a drift checklist.
OpenType https, www or spa and get the mod_rewrite rules for that job.
Enter https, www or spa in the input box.
Press Run to get the matching rewrite block.
Put redirects before SPA rules, with one RewriteEngine On.
Place the file in your web root and test a few URLs.
Your site on shared Apache hosting still loads over plain HTTP, or a React app returns 404 when someone refreshes on /dashboard. Both are fixed with a few lines of mod_rewrite in .htaccess, and the syntax is easy to get slightly wrong.
The input box takes one of three mode words, and Run produces the rules. https adds a 301 redirect from any HTTP request to the same host and path over HTTPS. www sends hosts that do not start with www. to the www version, also over HTTPS, in a single hop. spa serves real files and directories normally and routes every other path to /index.html, which is what client-side routers need. Any other word falls back to the https rules, so check the spelling.
Each mode outputs a complete block starting with RewriteEngine On. To combine modes, for example HTTPS plus SPA routing, put the redirect rules first and the SPA rules after them, with only one RewriteEngine line. Try a temporary 302 before committing to 301, because browsers cache permanent redirects. If the https rule loops behind a load balancer or CDN, Apache is seeing plain HTTP from the proxy, and the condition needs to check X-Forwarded-Proto instead.
The rules are generated in the browser. The HTTP status code list explains 301 versus 302, and if you run nginx rather than Apache, try the nginx server block generator.
Keyboard shortcut
Answers for this tool. For site-wide help, open the FAQ hub.
Not with these modes. The www option only goes from the bare domain to www. Reverse the condition and target by hand, matching hosts that start with www. and redirecting to the host without it.
Apache only reads .htaccess where AllowOverride permits it, and mod_rewrite must be enabled. On nginx and many managed platforms the file is ignored entirely.
Every path that is not an existing file or folder goes to index.html, including /api URLs served from the same host. Add a rule before it that skips your API prefix.