← All Tools

Mod_Rewrite Tester

Simulate Apache mod_rewrite rules and watch the URL transform, step by step.

All processing is 100% client-side. Your rules and URLs are never sent to any server.
How to use & what this simulates
  1. Paste your rewrite block (RewriteCond/RewriteRule lines) into Rewrite rules, or pick a sample.
  2. Set the server variables (host, HTTPS, method) used by your conditions.
  3. If your rules use -f/-d file checks, list the paths that exist under Existing files / directories (a browser cannot see your disk, so you declare it).
  4. Enter one or more test URLs (one per line) and press Simulate.
  5. Read the step-by-step trace: which rule matched, the captures, the resulting URI, the flags applied, and why it stopped.

This is a per-directory (.htaccess) emulator for Apache 2.4. See Emulation boundaries below for exactly what is and isn't simulated. When a rule uses something that cannot be faithfully emulated, it is flagged — never silently guessed.

Rewrite rules

Samples:

Server variables

Existing files / directories (for -f, -d, -s)

A browser cannot read your disk. List the paths that exist so file checks are evaluated against real facts, not a guess. Anything not listed is assumed not to exist (and that assumption is shown in the trace).

Test URLs

Results

Enter rules and test URLs, then press “Simulate”.

Quick reference

Pattern syntax

^ Start of string
$ End of string
. Any single character
.* Any characters (greedy)
(.+) Capture group
[a-z] Character class
\. Literal dot

Back-references & vars

$1–$9 RewriteRule captures
%1–%9 last RewriteCond captures
%{HTTP_HOST} Host header
%{REQUEST_URI} Request path
%{QUERY_STRING} Query string
%{HTTPS} on / off

Rule flags (emulated)

[L] Stop this pass
[END] Stop, no restart
[R=301] Redirect (301/302/…)
[NC] Case-insensitive
[QSA] / [QSD] Query append / discard
[F] / [G] 403 / 410
[S=n] Skip next n · [C] Chain

Condition flags

[NC] Case-insensitive
[OR] OR with the next condition
! Negate the pattern
-f / -d / -s File / dir checks
= < > -eq Comparisons

Emulation boundaries (what this does and does not simulate)

This tool is a simulator, so it is explicit about its limits. It never guesses: anything it cannot emulate is flagged in the trace.

How it evaluates

    Regex (JavaScript vs PCRE)

      References: Apache mod_rewrite, RewriteRule flags.