Turning query-string URLs into clean paths
Clean URLs like /product/42 are easier to read, share, and rank than query-string URLs like
product.php?id=42. Enter your script name, the query parameter it expects, and the URL prefix you
want to use, and this tool generates the Apache mod_rewrite rule that maps the clean URL to your
existing script - no code changes needed on your end, since the server transparently rewrites the request.
Why clean URLs tend to perform better for SEO and sharing
A clean, readable URL conveys what a page is about at a glance, which both search engines and users find more meaningful than an opaque query string - it's also more resistant to looking broken or suspicious when shared on social media or in a chat, where a long string of parameters can get truncated or flagged by some platforms' link previews.
Why this requires no changes to the script itself
mod_rewrite operates at the web server level, intercepting the incoming request and
internally rewriting it to the query-string form before your script ever runs - your PHP code still receives
exactly the same query-string parameter it always expected, which is why adding this rule retrofits
clean URLs onto an existing site without touching a single line of application code.
Why [L,QSA] specifically appears at the end of the generated rule
[L] tells Apache this is the last rule to check for a matching request, preventing it from
continuing to evaluate rules that might also match and cause unexpected double-rewriting. [QSA]
(Query String Append) preserves any additional query parameters a visitor's URL might already carry, merging
them with the rewritten request rather than silently dropping them.