URL Rewriting Tool

Generate an Apache rewrite rule from a URL pattern.

  • Free
  • No sign-up
  • Instant results

1 Your input

2 Result

Your result will appear here

Fill in the form and press the button. Results show up right here, without reloading the page.

How to use URL Rewriting Tool

  1. Enter the old pathType the address you want to retire in Old path, for example /old-page. The leading slash is removed for you.
  2. Enter the new pathType the destination in New path, either a path such as /new-page or a full URL.
  3. Copy the rule into .htaccessPress Run URL Rewriting Tool and copy the output into your .htaccess file, with RewriteEngine On and the RewriteRule on separate lines.

Common uses

  • Move a single page to a new slug on an Apache site
  • Clean up one legacy URL after a site migration
  • Draft a rule to hand over to your developer or host

Frequently asked questions

How do I use URL Rewriting Tool?

1. Enter the old path: Type the address you want to retire in Old path, for example /old-page. The leading slash is removed for you. 2. Enter the new path: Type the destination in New path, either a path such as /new-page or a full URL. 3. Copy the rule into .htaccess: Press Run URL Rewriting Tool and copy the output into your .htaccess file, with RewriteEngine On and the RewriteRule on separate lines.

What rule does it generate?

RewriteEngine On followed by a mod_rewrite rule in the form RewriteRule ^old-page$ /new-page [R=301,L]. R=301 sends a permanent redirect and L stops later rules for that request. It works on Apache with mod_rewrite enabled; Nginx ignores .htaccess files.

Does it escape special characters?

Yes. Characters with a special meaning in a regular expression, such as dots, question marks and brackets, are escaped with a backslash, so the old path matches literally.

Can it handle query strings or several URLs at once?

Query strings, yes: if the old address has one, the tool adds a RewriteCond line that matches it and ends the target with ? so the old parameters are dropped. Each run still writes one rule.

Is my input stored?

The two paths are sent to the GigaTools server, turned into text and returned. Nothing is tested against your site, and the tool does not save the paths.