.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)
.htaccess
# Generated by DevTools
Options -Indexes
# Force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteRule ^/old/(.*)$ /new/$1 [R=301,L]
# Custom error pages
ErrorDocument 404 /404.html
# Security headers
Header always set X-Content-Type-Options "nosniff"
Header always set X-Frame-Options "SAMEORIGIN"
Examples
Force HTTPS
HTTPS redirect onRewriteEngine 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
Toggle options
Switch on HTTPS redirect, no-indexes, or basic auth as needed.
Add rules and pages
Add rewrite rules with flags and error documents for the codes you care about.
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
Related guides
Getting the Most Out of .htaccess
The directives that matter in an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth.
Setting Up an Apache VirtualHost
The pieces of an Apache 2.4 VirtualHost — ServerName, DocumentRoot, Directory, aliases, and SSL — and how to enable it.
References & standards
Related tools
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
CHANGELOG Generator
Write a clean, consistent CHANGELOG entry in the Keep a Changelog format from grouped Added, Changed, Deprecated, Removed, Fixed, and Security notes
Chmod Calculator
Calculate Linux file permissions (777, 755 etc) easily.
CircleCI Config Generator
Generate a .circleci/config.yml — jobs with Docker images and run steps wired into a workflow
Cron Expression Builder
Build and validate cron expressions with visual interface and presets