Redirect Regex Tester

Think of Regex as a super-powered "Find and Replace" for your website addresses. Test your patterns here before they go live on your server.

How to use this tool:

  1. Regex Pattern: This is the "Find" rule. Use symbols to tell the server which URLs to target.
  2. Substitution: This is the "Replace" rule. The $1 represents whatever was captured in the parentheses of your pattern.
  3. Test URL: Paste a specific path here to see if your rule captures it.
  4. Live Result: Green means success, Red means no match.

Regex Symbol Cheat Sheet

^ Matches the start of the URL.
$ Matches the end of the URL.
. Matches any single character.
* Matches zero or more of the previous item.
( ) Creates a Capture Group (stored as $1).
/ A literal forward slash in your path.

Scenario: Migrating /news/ to /blog/

If you are changing your site structure from /news/post-name to /blog/post-name and want to move everything at once, use this setup:

Pattern: ^/news/(.*)
Substitution: /blog/$1

The (.*) captures the unique post name, and $1 puts it back at the end of the new /blog/ path.

Redirect Strategy FAQ

What is Regex (Regular Expressions)?

Regex is a standardized language used for pattern matching in text. In Technical SEO, we use it to write a single "Global Rule" that can handle thousands of redirects at once, rather than listing them one by one in a spreadsheet.

Is Regex case-sensitive?

By default, yes. However, most servers (like Apache or Nginx) allow you to add a flag (like [NC]) to make it case-insensitive. This tool uses standard JavaScript logic, which is usually case-sensitive.

Why is my Regex redirect not working on my server?

Check your "Server Flavor." Apache (.htaccess), Nginx, and Cloudflare all use slightly different versions of Regex. Always double-check your server documentation after testing your logic here.