Coding Tools

URL Rewriting Tool

Use this free URL Rewriting Tool to turn a dynamic URL with query parameters into a clean static-looking URL, along with the Apache RewriteRule needed to make it work. Read the guidance below before deploying, because rewriting has consequences most tools do not mention. No sign-up required.

Apache RewriteRule Instant Output 100% Free
1

Enter Your Ugly URL

Paste the URL with query parameters (the part with ? and &)

Examples - See How It Works

Before: product.php?id=123
After: product/123
Before: article.php?id=10&category=tech
After: article/10/tech
Before: user.php?name=john&action=profile
After: user/john/profile

Why You Are Here

You want cleaner URLs for readability. A URL a person can read, remember, and repeat aloud has genuine value, particularly where links get shared.

You are building URL structure for a new project. Deciding on a pattern before anything is live is the ideal time, because nothing has to be migrated.

You have been told dynamic URLs hurt your rankings. This is the most common reason people arrive here, and the claim is not accurate. 

What This Tool Does

The URL Rewriting Tool takes a dynamic URL containing query parameters and produces a static-looking equivalent, along with the Apache RewriteRule that maps one to the other.

Enter a URL such as products.php with type and name parameters, and the tool returns a clean form such as /products/software/finance and the rule to place in your .htaccess file.

The rule maps the clean URL back to the dynamic one. Your application does not change. It still receives the same parameters; only the address in the browser is different.

Google Does Not Recommend Rewriting Dynamic URLs

Nearly every page about this subject claims dynamic URLs rank worse and rewriting improves search performance. Google has said the opposite, directly.

Google's Search Central blog addressed this in a post titled Dynamic URLs vs. static URLs

Their conclusion was that Googlebot crawls and interprets dynamic URLs without difficulty, and that they recommend against rewriting them into static-looking forms.

Their reasoning is worth understanding

Parameters carry meaning. A URL containing id= and category= tells Google something about the page's role. A rewritten version that strips or reorders parameters can lose that information, and a rewrite done incorrectly can produce URLs that are harder for Google to interpret, not easier.

Google had already softened this in 2006

When they removed a guideline advising against id= parameters and stated that sites generating such URLs need not worry about rewriting them.

Major SEO authorities agree

Ahrefs' glossary answers the question should I replace dynamic URLs with static ones with a plain no, noting that search engines handle parameters fine and that badly maintained rewrites risk damaging the rankings of URLs that were working.

So what is rewriting actually good for?

Readability and shareability. A URL a person can read and repeat has real value for click-through, for links shared in messages and documents, and for anyone navigating your site by editing the address bar. Those are legitimate reasons. Ranking improvement is not one of them.

Rewriting Is Not Redirecting

These are confused constantly, including by tools that generate one while describing the other.

 

Rewriting

Redirecting

What happens

Server serves different content internally

Browser is sent to a new address

URL in the browser

Stays as typed

Changes to the destination

Round trips

One request

Two requests

Search engines see

One URL

A move, with a status code

Directive

RewriteRule without [R]

RewriteRule with [R=301], or Redirect

Use for

Making a URL display differently

Moving a URL permanently or temporarily

The [R] flag is the difference

Without it, Apache handles the mapping internally and the visitor never knows. With it, Apache sends the browser to a different address and the URL bar changes.

Getting this wrong on a live site causes real damage

A rewrite where a redirect belonged leaves two URLs serving the same content. A redirect where a rewrite belonged sends visitors to your raw dynamic URLs, undoing the entire point. For moving URLs rather than reshaping them, the Htaccess Redirect Generator is the right tool.

The Duplicate Content Problem Nobody Mentions

This is the most important practical consequence of rewriting, and no competing page appears to cover it.

After you add a rewrite rule, both URLs work
/products/software/finance                  <- the new clean URL

/products.php?type=software&name=finance    <- still resolves

The rule adds a new way to reach the page. It does not remove the old one. So you now have two addresses serving identical content, which is duplicate content by definition. Search engines may index both, links may accumulate to either, and ranking signals split across two URLs instead of consolidating on one.

The fix is a canonical tag on the page

<link rel="canonical" href="https://example.com/products/software/finance">

Do not solve this by redirecting the dynamic URL to the static one

That breaks your rewrite: the static URL maps internally to the dynamic one, which then redirects back to the static one, which maps to the dynamic one again. That is an infinite loop.

Also update your internal links

If your navigation, sitemap, and templates still emit dynamic URLs, the clean URLs exist but nothing points at them, and search engines will continue finding the dynamic versions first. A rewrite rule alone changes nothing that anyone sees.

A Deployment Sequence That Does Not Break Things

  1. Test the rule on a staging site first. .htaccess errors produce a 500 error across the entire site, not just the affected URL.
  2. Back up your existing .htaccess before making any change. Recovery is otherwise guesswork.
  3. Add RewriteEngine On once, at the top, if it is not already present.
  4. Deploy the rule and confirm the clean URL works.
  5. Confirm the dynamic URL still works. It will, and it needs to during the transition.
  6. Add canonical tags pointing at the clean version.
  7. Update internal links across navigation, templates, and sitemap.
  8. Watch Search Console for crawl errors and for both URL versions appearing in coverage reports.

When Rewriting Is and Is Not Worth It

Situation

Verdict

New project, nothing live yet

YES — design clean URLs from the start

URLs shared frequently in messages or print

YES — readability has real value

Existing site, URLs indexed and ranking

USUALLY NOT — the risk outweighs the gain

Chasing a ranking improvement

NO — Google says this does not work

Complex parameter combinations

NO — rewriting these reliably is difficult

Search, sort, and filter URLs

NO — these need parameters to function

The strongest case against rewriting an established site is that everything already works. Google is indexing your pages, links point at your URLs, and rankings exist. A rewrite introduces duplicate content, requires canonical tags and internal link updates to resolve, and delivers readability rather than rankings. That trade is worth making on a new build and questionable on a working one.

Server Compatibility

.htaccess rules are Apache-specific.

Server

Support

Apache

Yes, with mod_rewrite enabled

LiteSpeed

Yes, reads .htaccess

Nginx

NO — rules go in nginx.conf with different syntax

IIS

NO — uses web.config

Managed or serverless hosting

Often no .htaccess access at all

Nginx is the common surprise

It does not read .htaccess at all, and rules must be written into the server configuration with entirely different syntax and a server reload. A rule pasted into a file on an Nginx host does nothing.

Common Mistakes to Avoid

Rewriting an Established Site Expecting Better Rankings

Google's own guidance states that they crawl dynamic URLs without difficulty and recommend against rewriting them into static forms, and major SEO references agree. Rewriting a working site introduces duplicate content, requires canonical tags and internal link changes to resolve, and risks the rankings of URLs that were performing. The gain is readability, which is worth having on a new build and rarely worth the disruption on a live one.
Deploying a Rewrite Without a Canonical Tag

A rewrite rule adds a route to a page rather than replacing one, so the dynamic URL keeps working alongside the new clean URL. Two addresses serving identical content is duplicate content, and ranking signals split between them. Add a canonical tag pointing at the version you want indexed, and resist the instinct to fix it with a redirect, which creates an infinite loop against your own rewrite.
Editing .htaccess Directly on a Live Server

A syntax error in .htaccess returns a 500 error for the entire site, not merely the URLs the rule affects, and the error message rarely identifies the line responsible. Test on staging, keep a backup of the working file, and deploy during a period when a brief outage would be survivable. Recovering without a backup means reconstructing rules from memory while the site is down.

Quick Reference

Item

Detail

Rewriting

Internal. Redirecting is external

The [R] flag

Makes it a redirect

Google

Recommends against rewriting for SEO

Real benefit

Readability, not rankings

After a rewrite

Both URLs still work

That is

Duplicate content

Fix

A canonical tag

Never

Redirect dynamic to static — infinite loop

Internal links

Update them or nothing changes

.htaccess

Apache and LiteSpeed only

Nginx and IIS

Need different syntax

A syntax error

Breaks the entire site

Before editing

Back up, test on staging

Frequently Asked Questions

What is a URL rewriting tool?

A URL rewriting tool converts a dynamic URL containing query parameters into a clean static-looking equivalent and generates the Apache rule that maps between them. This URL Rewriting Tool produces both the rewritten URL and the RewriteRule to place in your .htaccess file.

Do static URLs rank better than dynamic URLs?

No. Google's Search Central blog addressed this directly and concluded that Googlebot crawls and interprets dynamic URLs without difficulty, recommending against rewriting them. Parameters carry meaning that a rewrite can lose. The genuine benefit of rewriting is readability for people, not ranking improvement.

What is the difference between rewriting and redirecting?

Rewriting changes what the server delivers while the URL in the browser stays as typed, handled internally in a single request. Redirecting sends the browser to a different address, which changes the URL bar and takes two requests. The [R] flag in a rule is what makes it a redirect rather than a rewrite.

Will the old dynamic URL still work after I add the rule?

Yes, and that is the part most guides omit. A rewrite adds a route rather than removing one, so both URLs resolve and serve the same content. That is duplicate content, and the fix is a canonical tag naming the version you want indexed. Redirecting the dynamic URL to the static one creates an infinite loop.

Does this work on Nginx?

No. .htaccess is an Apache feature, also supported by LiteSpeed. Nginx requires equivalent rules written into nginx.conf using different syntax, followed by a server reload, and IIS uses web.config. A rule pasted into a file on an Nginx host has no effect at all.

Why did my whole site break after editing .htaccess?

Because a syntax error in .htaccess returns a 500 error for every request, not only the URLs the rule was meant to affect. Restore your backup to bring the site back, then test the rule on staging. Always keep a copy of the working file before editing it.

Should I rewrite URLs on an existing website?

Usually not. If your pages are indexed and ranking, a rewrite introduces duplicate content and requires canonical tags plus internal link updates simply to return to where you started, in exchange for readability rather than rankings. Rewriting is far more attractive on a new project where nothing needs migrating.

Do I need to update my internal links after rewriting?

Yes, or nothing changes in practice. If your navigation, templates, and sitemap still generate dynamic URLs, the clean URLs exist but nothing links to them, and search engines keep finding the dynamic versions. Rules produced by this URL Rewriting Tool make the clean URL work; your site still has to actually use it.

Comments

Login to leave a comment

No comments yet. Be the first to comment!