Generate Apache, Nginx & Caddy rules for redirects, security & compression.
Paste or type your input here, .htaccess Generator is loading…
.htaccess Generator builds Apache configuration directives, redirects, HTTPS forcing, caching, compression, and access control, without you having to memorise the often-fiddly rewrite syntax.
An .htaccess file controls how Apache serves a directory and everything below it, applied on every request. That power comes with a real caveat: a single syntax error can throw a 500 error for the whole affected area, so always back up your current .htaccess before editing and keep a known-good copy to revert to. Generating correct rules reduces that risk.
Common uses it handles well are forcing HTTPS and standardising www/non-www with 301 redirects (which transfer ranking signals), plus caching and compression for performance. These are exactly the rules people most often need and most often get subtly wrong by hand.
One critical check: .htaccess is Apache-only. If your site runs on Nginx, these directives do nothing, you'd configure equivalents in server blocks instead. Generation runs in your browser with nothing uploaded. Pair it with the Robots.txt Generator and Sitemap Validator for your site's technical setup.
| Price | Free, no signup, no paywall, no watermark |
|---|---|
| Works on | Any modern browser: desktop, tablet, and mobile |
| Processing | In your browser, files never leave your device |
| Account required | None |
| Category | SEO Tools |
Enter your primary domain and open the workbench
The full-screen workbench opens: the generated config on the left (switch Apache / Nginx / Caddy any time), all controls on the right
Toggle features, add redirects (row by row or bulk-paste), and verify any URL in the redirect tester
Copy or download the config for your server (.htaccess, nginx.conf or Caddyfile)
Full-screen workbench: live Apache (.htaccess), Nginx and Caddy output on the left, every control on the right
Merges HTTPS + www canonicalization into a single 301, no redirect chains that waste crawl budget and link equity
Redirect tester, enter any request URL and see the exact hop chain your rules produce, with chain warnings
Bulk-paste 301 redirects (one "/old /new" per line) with duplicate and malformed-line handling, plus loop and chain detection
Custom 404 / 500 error pages emitted correctly for each server
Uses RewriteRule for all Apache redirects (avoids the mod_alias/mod_rewrite precedence bugs of mixing Redirect + RewriteRule)
Security headers, HSTS preload, gzip/brotli and long-cache rules
Forcing HTTPS and www/non-www canonicalization without a double redirect
Setting up 301 redirects for moved pages on Apache, Nginx or Caddy
Adding caching, compression and security headers for performance and safety
Migrating server config between Apache and Nginx
Always back up your existing .htaccess before adding rules, a syntax error can 500 the whole directory
Confirm your server is Apache; .htaccess does nothing on Nginx
Use 301 (permanent) redirects for moved pages so ranking signals transfer
Common questions about this tool, its workflow, and what to expect before you use it.
Apache HTTP Server Project
Reference for the RewriteRule and RewriteCond directives in the generated file.
No ratings yet. Be the first to say how .htaccess Generator worked for you.
Reviews appear here once our team has read them, so everything you see is from someone who signed in and used the tool.
Get notified about new tools, features, and tips. No spam, unsubscribe anytime.
Run a full live SEO audit of any URL: overall score plus an AI-search (AEO/GEO) score, metadata, technical, speed (Core Web Vitals), security & structured-data checks, and a point-by-point improvement roadmap.
Open toolTest your website's speed on mobile & desktop: real Google Lighthouse scores, real-user Core Web Vitals (LCP, INP, CLS), TTFB & server checks, loading filmstrip, page-weight breakdown, and prioritized fixes.
Open toolCrawl your whole website for a per-page SEO audit: missing or duplicate titles & meta descriptions, missing H1s, broken links, noindex pages, redirect chains, thin content and images without alt text. A free on-page site crawler.
Open toolValidate, fix & generate meta tags in one place: live-page audit, pixel-accurate desktop & mobile SERP previews, meta-readiness score, and export as HTML, Next.js or React Helmet.
Open toolValidate & preview Open Graph and Twitter/X card tags for Facebook, LinkedIn, X, Slack & more, from a live URL or by hand.
Open toolValidate & generate JSON-LD structured data, audit any URL's schema against Google Rich-Results rules, edit it live, or build new markup for 15+ types with a readiness score.
Open toolValidate, build & fix XML sitemaps, fetch any sitemap or crawl your site, edit URLs live with health checks, and export a compliant sitemap.xml.
Open toolPreview your page in Google on desktop & mobile with pixel-accurate truncation, keyword bolding and rich-result simulation.
Open toolWriting a roundup or tutorial? Embed the live .htaccess Generator so readers use it right on your page, or drop in a ready-made card that links to it. Free to use, always.
Preview
Generate Apache, Nginx & Caddy rules for redirects, security & compression.
Use .htaccess Generator free →Live tool (iframe)
Readers use the real, working tool right on your page, with a small credit line underneath.
Embed card (HTML)