Slug Generator

.htaccess · Nginx · Cloudflare

301 Redirect Generator

Paste old → new URL pairs, or old URLs with new page titles, and get 301 rules for Apache .htaccess, Nginx or a Cloudflare Bulk Redirects CSV. Duplicates, loops and chains are flagged before you deploy.

  • 100% in your browser
  • Up to 5,000 lines
  • Loop & chain checks

1. Paste old → new pairs

One redirect per line. Separate old and new with ->, a tab, a comma or a space. Lines starting with # are ignored. Processed in your browser.

2. Check the redirect map

  • 4 OK to export

4 redirects

LineOld URLNew URL (301)
2/blog/post?id=101/blog/creme-brulee-guide
3/old-about.html/about
4https://example.com/2019/05/seo-tips//blog/seo-friendly-urls
5/products/widget-v1/products/widget

3. 301 redirect rules

redirects.htaccessApache .htaccess
Redirect 301 /old-about.html /about
Redirect 301 /2019/05/seo-tips/ /blog/seo-friendly-urls
Redirect 301 /products/widget-v1 /products/widget

RewriteEngine On
RewriteCond %{QUERY_STRING} ^id=101$
RewriteRule ^blog/post$ /blog/creme-brulee-guide? [R=301,L]

Add to the .htaccess file in your site root (Apache with mod_alias; query-string rules need mod_rewrite).

Use this 301 redirect generator to turn a list of old and new URLs into ready-to-paste redirect rules for Apache .htaccess, Nginx, or a Cloudflare Bulk Redirects CSV. Paste old → new URL pairs, or pair each old URL with a new page title and get a clean slug for the target. Duplicate sources, redirect loops, and chains are flagged before you deploy. Everything runs in your browser, and nothing is uploaded or stored.

How it works

How to generate 301 redirects

  1. 01Choose a modeChoose Old URL → new URL to map addresses you already know, or Old → new title (slug) to create the new URL from a page title.
  2. 02PastePaste one redirect per line. Separate the two values with ->, a tab, a comma, or a space. Pasting two columns from a spreadsheet works because they arrive tab-separated.
  3. 03Set your siteOptional: enter your site URL so relative targets become absolute, and set a path prefix such as /blog/ for slugs made from titles.
  4. 04CheckCheck the redirect map and fix any warnings.
  5. 05ExportPick Apache, Nginx, or Cloudflare, then copy the rules or download the file.

Input examples

LineModeResult
/old-about.html -> /aboutOld URL → new URL/old-about.html redirects to /about
/blog/post?id=101, /blog/creme-bruleeOld URL → new URLQuery-string URLs get a matching rule
/blog/post?id=101 -> Crème Brûlée & CaféOld → new titleTarget becomes /creme-brulee-and-cafe
Old Post Title -> New Post TitleOld → new title/old-post-title redirects to /new-post-title

In title mode, any value that starts with / or http is kept as a URL. Any other value is turned into a slug with the same rules as the URL slug generator, including transliteration, stop words, and length limits.

Redirect formats

Apache .htaccess

Plain paths become Redirect 301 /old-path /new-path lines. Old URLs with a query string need RewriteCond and RewriteRule, because Redirect only matches the path. The generator writes these for you.

Nginx

Each redirect is a location = /old-path { return 301 /new-path; } block for your server block. Old URLs with a query string are matched on $request_uri.

Cloudflare Bulk Redirects

You get a CSV that a Cloudflare Bulk Redirect List can import: source URL, target URL, and status 301, with no header row. Cloudflare source URLs cannot include a query string, so it is removed. Set your site URL first so the source URLs use your domain.

Avoid chains and loops

A chain is a redirect whose target is redirected again, such as A → B → C. Each hop slows the page down and can waste crawl budget. With Flatten redirect chains turned on, every old URL points straight at its final address. A loop, such as A → B → A, cannot work in any browser, so it is reported as a warning instead.

Have a CSV of titles and old URLs? The bulk CSV slug generator creates slugs and redirect rules in one step. To learn when a slug change is worth it, read the URL slug SEO guide. Planning a whole migration? Follow our bulk URL change guide. Changing WordPress permalinks? Read the WordPress permalink guide.

Chain: two hops

/a/b/c

Flattened: one hop

/a/c/b/c

Loop: never resolves

/a/b/a

FAQ

Frequently asked questions

What is a 301 redirect?

A 301 is a permanent redirect. It tells browsers and search engines that a page has moved for good, so visitors and most link signals are passed to the new URL.

Should I use a 301 or a 302 redirect?

Use a 301 when the move is permanent, such as a changed slug or a site migration. Use a 302 only for temporary moves. This tool always writes 301 rules.

Can I redirect URLs with query strings?

Yes, for Apache and Nginx. The generator uses a query-string match for old URLs such as /post?id=7. Cloudflare Bulk Redirects cannot match query strings, so only the path is used there.

Where do I put the .htaccess rules?

Add them to the .htaccess file in your site's document root, above any CMS rewrite rules (such as the WordPress block), and test a few old URLs afterward.

How many redirects can I generate at once?

Up to 5,000 lines at a time. For larger migrations, split the list into batches.

Is my URL list uploaded anywhere?

No. Parsing and rule generation happen in your browser with JavaScript. Nothing is sent to a server, logged, or stored.

Changing slugs? Redirect the old ones first

Check your list for loops and chains, then paste the rules into your server or Cloudflare.