DevTools Logo

.htaccess Generator

.htaccess Generator

Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth.

Options

Rewrite rules

Error pages

Security headers (key: value, one per line)

Examples

Force HTTPS

Input
HTTPS redirect on
Output
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

A 301 redirect sends every HTTP request to the same URL over HTTPS.

About this tool

The .htaccess Generator writes an Apache .htaccess from a set of options: forced HTTPS, rewrite rules, custom error pages, security headers, basic auth, and disabled directory indexes. Each section is emitted in order with correct directive syntax — nothing is uploaded.

How to use this tool

  1. Toggle options

    Switch on HTTPS redirect, no-indexes, or basic auth as needed.

  2. Add rules and pages

    Add rewrite rules with flags and error documents for the codes you care about.

  3. Drop into the site

    Save the file as .htaccess in your document root.

Use cases

Pretty URLs

Rewrite friendly paths to internal handlers.

Lock down an admin area

Protect a directory with basic auth.

Common mistakes

Mistake:Using .htaccess on Nginx.

Fix:It is Apache-only; Nginx ignores .htaccess and needs its own rewrite rules.

Frequently asked questions

Will the generated .htaccess work on Nginx?

No — .htaccess is Apache-specific. Nginx does not read .htaccess files; its rewrites live in the server block.

How does the HTTPS redirect work?

It adds a RewriteCond that checks HTTPS off and a RewriteRule that 301-redirects to the https host, so all traffic is upgraded.

Is basic auth enough to secure a site?

It protects access but sends credentials in plain text over HTTP — pair it with the HTTPS redirect so logins are encrypted.

References & standards

.env Secret Safety Linter

Validate .env syntax and spot likely leaked credentials or placeholder secrets.

2D Fluid Dynamics & Particle Physics Sandbox

A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.

AI Function Calling Schema Generator

Generate function calling JSON schemas from TypeScript interfaces

Algorithm Arena & Data Structure Visualizer

Interactive arena for algorithms and data structures: eight sorting algorithms racing on one seeded input, six pathfinding algorithms walking generated mazes, and BST, AVL, Red-Black, B-tree, heap and trie operations replayed step by step with rotations highlighted. Every run shows the Big-O table and the phase-highlighted reference implementation in four languages, and compared values can be played as pitch (sonification) through the shared audio engine. Everything runs client-side; inputs never leave the browser.

Ansible Playbook Generator

Build an Ansible playbook — hosts, vars, and tasks with modules — as YAML

Apache Config Generator

Build an Apache 2.4 VirtualHost — ServerName, DocumentRoot, Directory, aliases, and optional SSL