Apache .htaccess Formatter & Validator
Guía
Apache .htaccess Formatter & Validator
Format and validate Apache .htaccess files with proper block indentation, syntax checking, and common error detection. Paste your .htaccess content and instantly see consistently formatted output with validation warnings for unclosed blocks, mismatched tags, invalid RewriteRule flags, and more. Includes common snippet templates and a RewriteRule flag reference.
Cómo utilizar
Paste your .htaccess content into the input area. The formatter processes it instantly — indenting block directives (IfModule, Directory, Files, etc.), normalizing comments, and validating syntax. Configure indent style (2 spaces, 4 spaces, or tabs), comment normalization, and blank line handling. Copy the formatted output or download it as an .htaccess file. Use the common snippets section to quickly insert standard configurations.
Características
- Block Indentation — Automatically indents nested directives inside IfModule, Directory, Files, FilesMatch, Location, LocationMatch, Limit, VirtualHost, Proxy, RequireAll, RequireAny, and other Apache block directives.
- Validación de Sintaxis — Real-time error detection: unclosed blocks, extra closing tags, mismatched block types, missing RewriteEngine directive, invalid RewriteRule flags. Color-coded with line numbers.
- RewriteRule Flag Checking — Validates flags in RewriteRule directives against the full list of known Apache flags (L, R, NC, QSA, NE, PT, P, F, G, C, CO, E, H, N, NS, S, T, B, DPI, END).
- Comment Handling — Preserves all comments with optional normalization (ensures space after #). Inline comments maintained in position.
- Formatting Options — Configurable indent style (2 spaces, 4 spaces, tab), comment normalization toggle, blank line collapsing.
- Common Snippets — Quick-insert templates: force HTTPS, trailing slash handling, custom error pages, IP blocking, GZIP compression, cache headers, directory listing prevention.
- RewriteRule Reference — Collapsible reference table with all RewriteRule flags and their descriptions, plus RewriteCond/RewriteRule syntax guide.
- Exportar — Copy formatted output or download as .htaccess file.
Validation Checks
Block matching: Every opening block tag must have a corresponding closing tag of the same type. RewriteEngine: Warns if RewriteRule or RewriteCond directives are used without RewriteEngine On. Flag validation: Checks RewriteRule flags against known Apache mod_rewrite flags. Duplicate detection: Alerts when the same directive appears multiple times (may be intentional but worth reviewing).
What is an .htaccess file?
What are the most common RewriteRule flags?
Why does my .htaccess redirect loop?
Is my .htaccess content sent to a server?
Instalar extensiones
Agregue herramientas IO a su navegador favorito para obtener acceso instantáneo y búsquedas más rápidas
恵 ¡El marcador ha llegado!
Marcador es una forma divertida de llevar un registro de tus juegos, todos los datos se almacenan en tu navegador. ¡Próximamente habrá más funciones!
Herramientas clave
Ver todo Los recién llegados
Ver todoActualizar: Nuestro última herramienta was added on Abr 10, 2026
