URL Rewriting Tool

Turn dynamic query-string URLs into clean static paths with the exact Apache rule to serve them.

Convert dynamic URLs to SEO-friendly static URLs instantly. Free URL rewriting tool generating Apache RewriteRules from :param templates.

Calculator Inputs

About Rewrite URLs

Turn dynamic query-string URLs into clean static paths with the exact Apache rule to serve them.

Paste the dynamic URL and the static shape you want, marking each variable segment with a :param placeholder that matches a query key. The generator emits one RewriteRule translating the clean path back to the script, preserving extra query strings via QSA.

Placeholder order follows the query string order. Test every rule with curl before deploying, and 301-redirect the old dynamic URLs to the new static ones. Everything runs in your browser.

Where it is used

Migrating legacy PHP/ASP pages to SEO URLs, documenting URL schemes, and teaching rewrite mechanics.

How to use the Rewrite URLs

  1. Dynamic URL (e.g. product.php?id=42&cat=shoes) — enter the value (e.g. product.php?id=42&cat=shoes).
  2. Static Template (use :param placeholders) — enter the value (e.g. /products/:cat/:id).
  3. Calculate — press the Calculate button to see the result instantly above.

Formula

Each :param becomes ([^/]+); query keys map to $1..$n in order; flags [L,QSA].

Examples

Example

dynamicUrl:product.php?id=42&cat=shoes
staticTemplate:/products/:cat/:id
Result: RewriteRule ^products/([^/]+)/([^/]+)/?$ product.php?cat=$1&id=$2 [L,QSA]

Frequently Asked Questions

Why QSA and not just the mapped params?
QSA appends any extra query string (tracking, pagination) instead of dropping it. Without QSA, ?page=2 style parameters vanish.
Do I still need the old dynamic URLs working?
Yes behind the scenes — the rule rewrites to them internally. Separately 301-redirect public dynamic URLs to the static form.
Nginx instead of Apache?
Same idea, different syntax: use rewrite with regex captures or try_files. The mapping logic this tool teaches transfers directly.