DNS Checker.eu

URL Rewrite Generator

Turn an ugly query-string URL into a clean, slash-separated path and get the matching Apache mod_rewrite rule to serve it - generated locally in your browser.

Query string to clean URL

Paste a dynamic URL with query parameters and get an Apache mod_rewrite rule that serves it from a clean, slash-separated path instead.

About URL Rewrite Generator

The URL Rewrite Generator takes a dynamic URL such as product.php?id=7&cat=3 and produces two things: the clean URL your visitors will use (/product/7/3) and the mod_rewrite rule that maps that pretty path back to the original script. It parses the URL's path and query string, derives the script name and each parameter, and writes a RewriteRule whose pattern captures one path segment per query parameter and rebuilds the original query internally.

The generated rule is technically precise. Each value becomes a ([^/]+) capture group so it matches a single path segment, the optional trailing-slash /? keeps both /product/7/3 and /product/7/3/ working, and the target reassembles the query as id=$1&cat=$2 in the same order the parameters appeared. It ends with the [L,QSA] flags - L stops further rewriting once the rule matches, and QSA (Query String Append) preserves any extra parameters a visitor tacks onto the clean URL. If you paste a URL with no query string, the tool tells you to add parameters, because there is nothing to rewrite.

Clean URLs are easier to read, share, and remember, and search engines generally prefer descriptive, keyword-friendly paths over long parameter strings. Because everything is computed in your browser, the URLs you paste are never uploaded - useful when you are working with internal or staging addresses. Place the generated rule in the .htaccess file of the folder that contains the target script (Apache with mod_rewrite enabled). Note that this rewrite makes the pretty path serve the dynamic script transparently; to also change the links your visitors see, update the URLs your application outputs to the clean form.

How to use it

  1. 1Paste a dynamic URL that includes a query string, for example https://example.eu/product.php?id=7&cat=3.
  2. 2Read the clean URL the tool derives - a slash-separated path built from the script name and parameter values.
  3. 3Copy the generated mod_rewrite rule from the output block.
  4. 4Place the rule in the .htaccess file of the folder containing the script, on an Apache server with mod_rewrite enabled.
  5. 5Update your application's internal links to point at the new clean paths so visitors and search engines see them.

Common use cases

  • -Converting legacy PHP pages with id and category parameters into readable, SEO-friendly paths.
  • -Making product, article, or category URLs shorter and easier to share on social media or in print.
  • -Improving crawlability by giving search engines descriptive path segments instead of long query strings.
  • -Prototyping mod_rewrite patterns quickly without writing the regular expression and backreferences by hand.
  • -Standardizing clean-URL structure across a site so every dynamic page follows the same path convention.

Frequently asked questions

What is a URL rewrite?
A URL rewrite maps a clean, human-readable path like /product/7/3 to a dynamic script such as product.php?id=7&cat=3 behind the scenes. The visitor sees the tidy URL while the server serves the original page, using an Apache mod_rewrite rule to translate between them.
What do the L and QSA flags do in a RewriteRule?
L means Last - it stops Apache from processing further rewrite rules once this one matches. QSA means Query String Append - it preserves any extra query parameters the visitor adds to the clean URL and passes them through to the target script.
Where should I put the generated mod_rewrite rule?
Place it in the .htaccess file of the folder that contains the target script, on an Apache server with mod_rewrite enabled. The rule's pattern is relative to that directory, so putting it alongside the script keeps the paths correct.
Why does the tool say my URL has no query string?
The rewrite rule is built from the query parameters, so the URL must contain a query string such as ?id=7&cat=3. If there are no parameters there is nothing to map to path segments, and the tool asks you to add them.
Do clean URLs actually help SEO?
Descriptive, slash-separated URLs are easier for people to read and share and give search engines readable, keyword-relevant path segments instead of opaque query strings. They are one contributing factor to good on-page SEO, though not a ranking guarantee on their own.
Is the URL I paste uploaded anywhere?
No. The URL Rewrite Generator runs entirely in your browser, so the addresses you paste - including internal or staging URLs - are processed locally and never sent to any server.