URL Rewriting Tool

Convert any URL into Apache mod_rewrite rules for your .htaccess file. Generate clean SEO-friendly URL redirect rules instantly.

How to use

  1. 1. Paste the URL you want to create a rewrite rule for.
  2. 2. Click Generate to produce the mod_rewrite rule.
  3. 3. Copy and paste into your server's .htaccess file.
  4. 4. Ensure Apache's AllowOverride All is set in your vhost config.
Share

Free URL Rewriting Tool — Generate mod_rewrite .htaccess Rules

Clean, readable URLs are essential for SEO and user experience. Search engines prefer descriptive URLs over parameter-laden dynamic ones, and users trust and share clean URLs more readily. URL rewriting transforms ugly URLs like /index.php?category=shoes&id=456 into clean paths like /shoes/456 through Apache's mod_rewrite module. This free URL Rewriting Tool generates the correct .htaccess RewriteRule syntax from your URL patterns without requiring regular expression expertise.

Enter your existing URL pattern and the clean URL you want to present, and the tool generates the RewriteRule and RewriteCond directives for your .htaccess file. The generated rules handle query string mapping, optional parameters, and conditional rewrites.

URL rewriting is foundational to most CMS platforms. WordPress's permalink system uses mod_rewrite to serve /category/post-title instead of /index.php?p=123. Understanding how it works lets you customize URL structures, fix legacy URL patterns, and implement canonical URLs for SEO.

URL Rewriting Concepts

RewriteEngine On. Must be at the top of your .htaccess file (or server config) to enable mod_rewrite. Without this, all RewriteRule directives are ignored.

RewriteRule. The core directive: RewriteRule pattern substitution [flags]. Pattern is a regex matching the incoming URL. Substitution is what it rewrites to. Flags control behavior (L = last rule, R=301 = redirect).

RewriteCond. A condition that must be true before the following RewriteRule applies. Used to check server variables, check if a file exists, or exclude certain paths.

Flags. [L] = stop processing more rules after this one. [R=301] = redirect instead of rewrite. [QSA] = append query string. [NC] = case-insensitive match. [F] = return 403 Forbidden.

Related Tools

Frequently Asked Questions

What is URL rewriting?

Server-side URL transformation that shows clean URLs to users while routing to dynamic backend paths.

What is mod_rewrite?

Apache module enabling regex-based URL rewriting via .htaccess files. Used by WordPress and most PHP CMSs.

Rewrite vs redirect?

Rewrite = internal, URL bar unchanged. Redirect = browser gets new URL, bar changes. Different purposes.

Is this free?

Yes. Completely free, no account needed.