DEV Community

Dev Nestio
Dev Nestio

Posted on

Browser-Only .htaccess Generator with Section Toggles

Apache .htaccess files are powerful but tedious to hand-write. I built a visual generator with toggleable sections — no server, no upload.

Try it: https://devnestio.pages.dev/htaccess-gen/

Sections

  • Redirects (301/302), Force HTTPS, Basic Auth, CORS, Error Pages, Directory Options

Highlights

  • Syntax-highlighted output (directives, values, comments)
  • Copy to clipboard or download as .htaccess
  • Toggle each section on/off independently
function downloadOutput() {
  const raw = document.getElementById("htaccess-output").dataset.raw;
  const blob = new Blob([raw], { type: "text/plain" });
  const a = document.createElement("a");
  a.href = URL.createObjectURL(blob);
  a.download = ".htaccess";
  a.click();
}
Enter fullscreen mode Exit fullscreen mode

DevNestio — browser-only developer tools.

Top comments (0)