Mod_Rewrite Tester
Simulate Apache mod_rewrite rules and watch the URL transform, step by step.
How to use & what this simulates
- Paste your rewrite block (
RewriteCond/RewriteRulelines) into Rewrite rules, or pick a sample. - Set the server variables (host, HTTPS, method) used by your conditions.
- If your rules use
-f/-dfile checks, list the paths that exist under Existing files / directories (a browser cannot see your disk, so you declare it). - Enter one or more test URLs (one per line) and press Simulate.
- 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
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 dotBack-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 / offRule 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] ChainCondition flags
[NC] Case-insensitive[OR] OR with the next condition! Negate the pattern-f / -d / -s File / dir checks= < > -eq ComparisonsEmulation 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.