← Toolz / Generators / Redirect Generator

Redirect Generator

GEN·02
FreeNo sign-upRuns in your browser
1. YOUR REDIRECT RULES0 rules
MatchOld URL or pathNew URL or pathCode
Separate with a comma, tab or space.
Match types: Exact changes one address. Prefix moves a whole folder and keeps the rest of the path (/blog/ to /articles/). Regex uses a pattern, and $1, $2 in the new URL are filled from the pattern.
SITE-WIDE OPTIONS (APACHE AND NGINX)
WWW
Trailing slash
2. GET THE CODE

3. CHECKS
Points each exact rule straight at its final destination.
TEST A URL
Enter an address to see which rule matches and where it ends up.

Create ready-to-use redirect code for any URL.

100% free · No sign-up · No daily limits · No watermarks · Processed in your browser — files never leave your device

UNDERSTAND YOUR RESULTS

Redirect Generator — .htaccess, Nginx & Meta Refresh Rules guide

Redirect Generator: enter the source and destination paths, choose the supported format and review the generated rule. Build one rule or a whole set for a site move, in Apache .htaccess, Nginx and meta-refresh formats, with Exact, Prefix and Regex matching.

How to use this tool

  1. Enter the source path and the destination path or full URL it should point to.
  2. Choose the match type — Exact for one page, Prefix for everything under a path, Regex for pattern-based rules — and the output format for your server.
  3. Review the generated rule, then copy it into your server configuration or download the set.
  4. Test on a staging site, or with one low-risk URL first, before rolling the full set out to production.

A worked example

Prepare a permanent redirect from an old public path to its replacement: /old-page/ to /new-page/ as an Exact match produces a 301 rule in the format you picked, ready to paste into your configuration.

What you can do with this tool

How it works

The generator writes rules in the syntax each server expects: Apache mod_alias/mod_rewrite lines for .htaccess, Nginx rewrite or return directives, and HTML meta-refresh or header snippets where server rules are not possible. Match types decide how much of the incoming path the rule compares — Exact compares the whole path, Prefix everything beginning with the source, and Regex a pattern you supply.

Frequently asked questions

What is the difference between Exact, Prefix and Regex matching?

Exact changes one address only. Prefix moves a whole folder and keeps the rest of the path, so /blog/ to /articles/ carries the page name across with it. Regex matches on a pattern instead of a fixed path, and $1, $2 in the new URL are filled in from the parts the pattern captures. Start with Exact or Prefix unless you genuinely need a pattern.

How do I know the generated rules will work on my server before I use them?

Do not paste them straight into production. Server syntax differs, so generate the format for your server, test on staging first, and use the Checks section and the Test a URL box on this page — enter an address and see which rule matches and where it ends up. Watch especially for loops and for broad Prefix or Regex rules that catch pages you meant to leave alone, and point each exact rule straight at its final destination rather than chaining redirects.

Can I create a lot of redirects at once, or move a whole site?

Yes. Paste many rules at once, one per line in the form old, new, optional code, separated by a comma, tab or space. The site-wide options cover the common whole-site jobs for Apache and Nginx — force HTTPS, remove .html, the WWW choice, trailing slash, and moving to a new domain — and there is a 'Keep query string' option where the format supports it.

Is anything I enter uploaded?

The tool is labelled 'Runs in your browser' and needs no sign-up, so you build the rules on the page rather than submitting your site structure to a service. The generated code still has to be added to your own server or site configuration by you — this page creates the code, it does not install or activate any redirect.