URL Rewrite Tester
Test, simulate, and debug Nginx and Apache RegEx URL rewrite and redirect rules with live capture group evaluation.
Rule & URI Simulation Editor
Execution Trace
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
Simulates standard configuration grammar across leading web server platforms.
Accurately reflects resulting HTTP redirect status codes or internal pass-through.
Comprehensive parsing of critical routing and query handling flags.
Replaces positional token placeholders with matched substring values.
Pure in-browser simulation executing with zero network transmission.
Step-by-Step Workflow
Select Server Directives Dialect
Choose between Nginx or Apache depending on whether you are authoring nginx.conf server blocks or Apache .htaccess rules.
Enter Test Request URI and Pattern
Input the mock incoming request URI path, your regular expression pattern, and your desired destination substitution path.
Configure Directives Flags
Specify server flags such as permanent, redirect, last, or break for Nginx, or [R=301,L,NC,QSA] for Apache.
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.
Master this tool with Guides & Articles
Learn the workflows, common mistakes, and advanced techniques behind URL Rewrite Tester - RegEx Redirect & Nginx/Apache Simulator with our deep-dive educational content.
How to Check File Size Before Uploading Files Online
Learn how to check file size before uploading files to email platforms, CMS systems, cloud storage, APIs, and messaging apps. Explore browser-native payload analysis, upload compatibility checks, transfer estimates, and file optimization workflows with SHRTX.
Deep Linking Guide: Connecting Web, Mobile, and Desktop Routes
Learn how deep links, Universal Links, Android App Links, fallback URLs, QR flows, and deferred routing connect app paths.
Designing Glitch Art with Browser-Native Image Workflows
Learn databending, JPEG and PNG corruption behavior, pixel-sorting pipelines, and browser-local rendering workflows for glitch art.