Skip to main content
URL & LINK TOOL
⚡

URL Rewrite Tester

Test, simulate, and debug Nginx and Apache RegEx URL rewrite and redirect rules with live capture group evaluation.

✓Nginx & Apache mod_rewrite rule parsing
✓RegEx capture group ($1, $2) substitution evaluation
Rewrite ResultHTTP 301 Match
Incoming Request URI
/blog/2026/08/url-architecture
Target Rewritten URI
/posts/2026/08/url-architecture

Rule & URI Simulation Editor

Execution Trace

Testing Input URI Path: "/blog/2026/08/url-architecture"
Server Directive Dialect: Nginx rewrite
RegEx Pattern: "^/blog/(.*)$"
Substitution Target: "/posts/$1"
Result: Match SUCCESS! Extracted 1 capture group(s).
Group $1 / %1: "2026/08/url-architecture"
Substituted Destination URI: "/posts/2026/08/url-architecture"
Final Action: External Redirect (HTTP 301)

Client-Side Nginx and Apache RegEx Rewrite Rule Simulation

The URL Rewrite Tester provides a diagnostic workbench for testing and debugging regular expression rewrite directives prior to deploying configuration files to production web servers. Web server rewrite rules control routing pipelines, handle legacy URL migrations, enforce canonical URL naming conventions, and redirect traffic during site restructuring. A single misplaced caret, unescaped period, or misunderstanding of capture group indexing can cause infinite redirect loops or unintended 404 HTTP errors across thousands of web pages.

This utility simulates the core parsing and substitution logic of both Nginx rewrite directives and Apache mod_rewrite rules directly inside your web browser. Operators can enter a test request URI alongside a target regular expression pattern, a substitution template, and server flags. The simulation engine resolves numbered capture groups ($1, $2, %1), accounts for Apache .htaccess leading slash strip behavior, evaluates case-insensitive matching flags, and simulates query string handling such as Apache QSA and QSD or Nginx trailing question mark query discards.

It is important to emphasize that this client-side utility is a specialized regular expression simulation rather than a full live Nginx or Apache daemon. It does not execute filesystem condition checks such as Apache RewriteCond or Nginx try_files directives, nor does it emulate multi-pass internal request re-entry loops. However, for rapid verification of regular expression matching, capture group replacement, and HTTP redirect status code assignment, it delivers transparent, step-by-step execution logs without touching live server infrastructure.

Core Tool Capabilities

  • Dual Server Dialect Simulation: Simulates syntax conventions for both Nginx rewrite directives and Apache HTTP Server mod_rewrite RewriteRule directives.
  • Dynamic Capture Group Extraction: Resolves parenthetical regular expression capture groups into numbered variables ($1 through $9 and %1 through %9) for live substitution.
  • Server Flag Resolution Engine: Interprets common server flags including permanent 301 redirects, temporary 302 redirects, internal rewrites, and case-insensitive matching.
  • Query String Behavior Modeling: Models query string behaviors including Apache QSA (append), Apache QSD (discard), and Nginx trailing question mark query stripping.
  • Granular Step-by-Step Execution Logs: Generates an audit trail of regex pattern compilation, input path normalization, group extraction, and final URI construction.
  • Completely Offline Local Processing: Runs all regular expression evaluations inside local browser memory, ensuring private server configuration paths remain confidential.

Local Browser Privacy

Your files are processed locally on your device. Files are not uploaded, transmitted, or stored on remote servers.

Once the page has loaded, you can disconnect your network connection and continue using this tool offline.

Target Use Cases

  • • Website Redesign and SEO URL Migrations
  • • Web Server Configuration Debugging
  • • Canonical Trailing Slash and Casing Enforcement
  • • Query Parameter Preservation Verification

Technical Specifications & Platform Limits

Supported Server Directives
Nginx rewrite and Apache mod_rewrite RewriteRule

Simulates standard configuration grammar across leading web server platforms.

Evaluated Status Codes
HTTP 200 (Internal Rewrite), 301 (Permanent), 302 (Temporary)

Accurately reflects resulting HTTP redirect status codes or internal pass-through.

Supported Flag Directives
Nginx: last, break, redirect, permanent, and Apache: R=301, R=302, L, NC, QSA, QSD

Comprehensive parsing of critical routing and query handling flags.

Capture Group Variables
$1-$9 (Nginx and Apache) and %1-%9 (Apache)

Replaces positional token placeholders with matched substring values.

Execution Environment
Client-side JavaScript RegExp engine

Pure in-browser simulation executing with zero network transmission.

Step-by-Step Workflow

1

Select Server Directives Dialect

Choose between Nginx or Apache depending on whether you are authoring nginx.conf server blocks or Apache .htaccess rules.

2

Enter Test Request URI and Pattern

Input the mock incoming request URI path, your regular expression pattern, and your desired destination substitution path.

3

Configure Directives Flags

Specify server flags such as permanent, redirect, last, or break for Nginx, or [R=301,L,NC,QSA] for Apache.

4

Review Match Result and Execution Logs

Inspect the final rewritten URI, resulting HTTP status code, and detailed execution logs detailing each step of pattern evaluation.

Practical Real-World Use Cases

Website Redesign and SEO URL Migrations

Webmasters and SEO specialists testing regular expression rewrite rules to ensure old blog and product paths map accurately to new URL structures.

Web Server Configuration Debugging

DevOps engineers and system administrators validating rewrite syntax before committing changes to production Nginx or Apache configuration files.

Canonical Trailing Slash and Casing Enforcement

Site architects testing rules designed to enforce lowercase URL paths or strip trailing slashes uniformly across incoming requests.

Query Parameter Preservation Verification

Digital marketers checking that campaign query parameters pass through clean URL rewrites without being inadvertently stripped.

Frequently Asked Questions

How does this client-side rewrite tester differ from running a live web server like Nginx or Apache?
This tool is a client-side regular expression simulation that models URI path matching, capture group substitutions, and flag parsing using JavaScript RegExp algorithms. It does not run a compiled Apache or Nginx binary, meaning it cannot evaluate server filesystem conditions such as -f (file exists) or -d (directory exists), nor does it process multi-pass request re-entry cycles. It serves as a rapid testing workbench for regular expression syntax and redirect logic before deploying rules to production.
What is the practical difference between an internal rewrite and an external HTTP redirect?
An internal rewrite alters the target resource path on the web server without modifying the URL displayed in the user browser address bar, returning an HTTP 200 status code. An external redirect sends an HTTP 301 or 302 response header instructing the browser to issue a new request to a different destination URL, which updates the address bar. Internal rewrites are commonly used for clean URL routing, whereas external redirects are required for canonical domain changes and permanent page migrations.
How do Nginx and Apache handle existing query strings during a rewrite by default?
Both Nginx and Apache append the original request query string to the rewritten destination by default unless explicitly instructed otherwise. In Nginx, adding a trailing question mark to the replacement string causes the server to discard the original query parameters entirely. In Apache, the original query string is preserved automatically, but you can explicitly append new query parameters using the QSA flag or discard original query parameters using the QSD flag.
Why does Apache .htaccess regular expression matching require stripping the leading forward slash?
In an Apache per-directory .htaccess context, the server automatically strips the directory path and leading slash before evaluating RewriteRule patterns, so ^blog/(.*)$ matches rather than ^/blog/(.*)$. In contrast, virtual host server configuration files and Nginx server blocks evaluate the entire normalized request URI path starting with the leading forward slash. This simulation tool automatically accounts for this difference by testing stripped paths when Apache mode is selected.
Are my server rewrite patterns, internal URLs, or test paths sent to external servers?
No. All regular expression compilation, string substitution, and execution trace logging execute entirely inside your local browser memory using client-side JavaScript. Private internal server paths, unpublished staging URLs, and proprietary routing patterns are never transmitted across the network, logged in remote databases, or exposed to third parties. You can safely debug private production server rules offline.

Share this tool

Help others discover this utility. No login or registration required.