Apache .htaccess Formatter & Validator
ガイド
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.
使い方
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.
特徴
- Block Indentation — Automatically indents nested directives inside IfModule, Directory, Files, FilesMatch, Location, LocationMatch, Limit, VirtualHost, Proxy, RequireAll, RequireAny, and other Apache block directives.
- 構文検証 — 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.
- エクスポート — 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?
恵 スコアボードが到着しました!
スコアボード ゲームを追跡する楽しい方法です。すべてのデータはブラウザに保存されます。さらに多くの機能がまもなく登場します!
