Tidak suka iklan? Pergi Bebas Iklan Hari ini

Apache .htaccess Formatter & Validator

Pengembang
IKLAN · MENGHAPUS?
MEMASUKKAN
RewriteRule Flag Reference
FlagNamaKeterangan
LTerakhirStop processing further rules
R[=code]RedirectIssue an external redirect (default 302)
NCNo CaseCase-insensitive pattern matching
QSAQuery String AppendAppend query string to substitution URL
NENo EscapeDon't escape special characters in output
PTPass ThroughPass to next handler (useful with Alias)
PProxyForce proxy request for substitution
FForbiddenReturn 403 Forbidden response
GGoneReturn 410 Gone response
CRantaiChain current rule with the next rule
COCookieSet a cookie
EEnvSet an environment variable
HHandlerForce a content handler
NBerikutnyaRe-run rules from the start
NSNo SubrequestSkip rule for internal sub-requests
SSkipSkip the next N rules
TJenisForce MIME type
BEscape BackreferencesEscape non-alphanumeric backreference chars
DPIDiscard Path InfoDiscard PATH_INFO from rewritten URI
ENDAkhirStop processing and don't apply more rules

RewriteCond sets a condition that must match before the next RewriteRule is applied. Syntax: RewriteCond TestString CondPattern [flags]. Multiple RewriteCond lines before a RewriteRule are combined with AND logic by default.

Common Snippets
IKLAN · MENGHAPUS?

Memandu

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.

Cara Penggunaan

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.

Fitur

  • Block Indentation — Automatically indents nested directives inside IfModule, Directory, Files, FilesMatch, Location, LocationMatch, Limit, VirtualHost, Proxy, RequireAll, RequireAny, and other Apache block directives.
  • Validasi Sintaksis — 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.
  • Ekspor — 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).

IKLAN · MENGHAPUS?

What is an .htaccess file?

An .htaccess (hypertext access) file is a directory-level configuration file for Apache HTTP Server. It allows you to override server configuration on a per-directory basis without editing the main httpd.conf. Common uses include URL rewriting (pretty URLs, redirects), access control (password protection, IP blocking), custom error pages, MIME type configuration, and caching headers. The file is named .htaccess (with a leading dot) and is placed in the directory you want to configure.

What are the most common RewriteRule flags?

The most frequently used flags are: [L] (Last — stop processing rules), [R=301] (Redirect — send HTTP redirect, 301 for permanent), [NC] (No Case — case-insensitive matching), [QSA] (Query String Append — preserve existing query string), [NE] (No Escape — don’t encode special characters), [P] (Proxy — handle via mod_proxy), [F] (Forbidden — return 403), and [END] (like L but also prevents further .htaccess processing in subdirectories). Multiple flags are combined with commas: [L,R=301,NC].

Why does my .htaccess redirect loop?

Redirect loops usually happen when a RewriteRule matches its own output. For example, redirecting all requests to HTTPS will loop if the rule doesn’t check whether the request is already HTTPS. Always add a RewriteCond before redirect rules: RewriteCond %{HTTPS} off (for HTTPS redirects) or RewriteCond %{REQUEST_URI} !^/target (to exclude the target path). Also check for conflicting rules — multiple redirect rules can create circular references. The [L] flag helps by stopping rule processing after a match.

Is my .htaccess content sent to a server?

No — all formatting and validation happens in your browser using JavaScript. Your .htaccess content never leaves your device. This is important because .htaccess files can contain sensitive configuration: access control rules, internal paths, IP addresses, and security settings. All processing runs entirely client-side with no API calls or data storage.

Ingin bebas iklan? Bebas Iklan Hari Ini

Instal Ekstensi Kami

Tambahkan alat IO ke browser favorit Anda untuk akses instan dan pencarian lebih cepat

Ke Ekstensi Chrome Ke Ekstensi Tepi Ke Ekstensi Firefox Ke Ekstensi Opera

Papan Skor Telah Tiba!

Papan Skor adalah cara yang menyenangkan untuk melacak permainan Anda, semua data disimpan di browser Anda. Lebih banyak fitur akan segera hadir!

IKLAN · MENGHAPUS?
IKLAN · MENGHAPUS?
IKLAN · MENGHAPUS?

Pojok Berita dengan Sorotan Teknologi

Terlibat

Bantu kami untuk terus menyediakan alat gratis yang berharga

Belikan aku kopi
IKLAN · MENGHAPUS?