A free browser-based Apache .htaccess file builder. Toggle HTTPS redirects, browser caching, gzip compression, security headers, hotlink protection, and custom redirect rules — then copy the generated file in one click.

.htaccess Generator is a free, browser-based tool that builds a valid Apache .htaccess file from a visual configuration interface. Toggle rules on or off, add custom redirect rules, set error page paths, and copy the result — no Apache expertise required.
Every developer who has worked with Apache or shared hosting has spent time hunting down the correct .htaccess syntax. Force HTTPS redirect, remove www, set caching headers, enable gzip, block bad bots — each rule has its own syntax quirks. One wrong line breaks the whole site.
Most Apache documentation is scattered across outdated Stack Overflow answers, conflicting tutorials, and the official mod_rewrite docs. There was no clean, visual way to build a complete .htaccess file from scratch.
The tool is organized into four configuration tabs:
Basic — Enable force HTTPS, choose WWW redirect direction (force or remove), disable directory listing, and configure custom error pages (400, 401, 403, 404, 500, 503).
Performance — Toggle gzip compression via mod_deflate and browser caching via mod_expires. The caching rules use sensible defaults: images and static assets cached for one year, CSS/JS for one month, HTML uncached.
Security — Add X-Frame-Options, X-Content-Type-Options, and Referrer-Policy headers via mod_headers. Block known scraper bots (AhrefsBot, MJ12Bot, SemRushBot, DotBot) and enable image hotlink protection with a configurable allowed domain.
Redirects — Add any number of 301 or 302 redirect rules. Each rule has a from-path and a to-URL field, with the redirect type selectable per-rule.
The live .htaccess output updates instantly as configuration changes. A single Copy button copies the full file to clipboard. All generation happens in the browser — nothing is sent to a server.
Built on Next.js 16 with the App Router, TypeScript strict mode, Tailwind CSS v4, and shadcn/ui. The .htaccess generation logic is a pure TypeScript function that takes the configuration state object and produces the output string — testable, predictable, and zero dependencies.
The generator handles edge cases properly: it only adds RewriteEngine On once regardless of how many rules need it, skips empty redirect rules, trims whitespace from domain inputs, and strips https:// prefixes from the hotlink domain field automatically.
Google Analytics G-4ZFEX1Y93F is loaded via next/script with afterInteractive strategy. The Vercel deployment uses the wildcard CNAME at *.tools.jagodana.com — no manual DNS verification needed.
mod_rewriteOptions -Indexesmod_deflate for 8 content typesmod_expires with sensible per-type expiryX-Frame-Options, X-Content-Type-Options, Referrer-PolicySetEnvIfNoCasemod_rewrite with configurable allowed domainTry it at htaccess-generator.tools.jagodana.com
The client needed a robust developer tools solution that could scale with their growing user base while maintaining a seamless user experience across all devices.
We built a modern application using Apache and .htaccess, focusing on performance, accessibility, and a delightful user experience.
Category
Developer Tools
Technologies
Date
April 2026
More work in Developer Tools