Skip to content

301 redirect .htaccess generator: turn your URL list into rules

Paste old and new URLs, up to 10,000 rows, and get exact-match 301 redirect .htaccess rules, or rules for nginx and four more servers, with chains collapsed and loops removed.

Paste two columns from a spreadsheet, a CSV, or pairs separated by spaces. Paths (/old) or full URLs. An optional third column sets the status (301, 302, 307, 308). Up to 10,000 rows.

Processed in your browser. Your list is never uploaded.

6 rules ready, 2 notes below.

2 notes on your input

  • Line 3/shop/red-shirt → /products/red-shirt continues 1 more hop; pointed straight at /products/red-shirt-2026
  • Line 8/old-page redirects to itself, dropped

Your redirect rules

Paste at the top of .htaccess in the site root, above other rewrite rules.

.htaccess
# Exact-match redirects, generated by getReport (getreport.app/tools/redirect-generator)
# Place above other rewrite rules (for WordPress: above "# BEGIN WordPress").
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^shop/blue-shirt$ /products/blue-shirt [R=301,L]
RewriteRule ^shop/red-shirt$ /products/red-shirt-2026 [R=301,L]
RewriteRule ^products/red-shirt$ /products/red-shirt-2026 [R=301,L]
RewriteRule ^about-us\.html$ /about [R=301,L]
RewriteCond %{QUERY_STRING} ^page=contact$
RewriteRule ^index\.php$ /contact? [R=301,L]
RewriteRule ^blog/2019/sale$ https://example-shop.hr/blog/ [R=301,L]
</IfModule>
  • Free, no account
  • Runs in your browser
  • Up to 10,000 rows

What the 301 redirect generator writes

Rules for Apache, nginx, Cloudflare Bulk Redirects, Netlify, Vercel and Caddy, built from your list in your browser.

  • Paste it as you have it

    Two columns from a spreadsheet, a CSV, or pairs separated by spaces, with an optional status per row.

  • Every row checked

    Sources on another domain, targets that are not URLs, duplicates, conflicting rows and redirects to themselves are flagged.

  • Loops and chains fixed

    Loops (A → B → A) are removed and chains (A → B → C) are pointed straight at their final page.

  • Exact matches only

    A plain Apache Redirect line also catches everything below the path. Here /shop redirects /shop and nothing else.

  • Query strings handled

    URLs such as /index.php?page=contact get the right construct for each server.

  • Six server formats

    Apache .htaccess, nginx, Cloudflare Bulk Redirects, Netlify, Vercel or Caddy.

Show 2 more checks
  • Query strings handled

    URLs such as /index.php?page=contact get the right construct for each server.

  • Six server formats

    Apache .htaccess, nginx, Cloudflare Bulk Redirects, Netlify, Vercel or Caddy.

How the .htaccess redirect generator works

  1. Paste your list

    Paste old and new URLs, one pair per row. The list is parsed as you type.

  2. Review the warnings

    Duplicates, conflicts, loops and chains are reported, and chains are pointed at their final page before a rule is written.

  3. Copy the rules

    Pick your server and copy the exact-match 301 rules into its configuration.

The rules come from your list only; the tool doesn't request any URL. After deploying, paste the old URLs into the bulk URL checker to confirm each takes one hop.

Redirect rule questions

How do I redirect URLs with query strings?

Paste the full old URL with its query string, such as /index.php?page=contact, and the generator writes the construct each server needs, such as a RewriteCond on the query string for Apache. A plain Redirect line in Apache ignores query strings, which is why hand-written rules for such URLs often seem to do nothing. Pick your server and copy the rules.

Which servers can the generator write rules for?

Apache .htaccess, nginx, Cloudflare Bulk Redirects, Netlify, Vercel and Caddy. Paste your old and new URLs once and switch between formats. Every rule is an exact match, so /shop redirects only /shop and not everything below it, and chains in your list are pointed straight at their final page before a rule is written.

How do I set up 301 redirects for many pages at once?

Start from a spreadsheet with the old URL in one column and the new URL in the other, then paste both columns above. The tool flags duplicates, conflicts and loops, points chains straight at their final page and writes one exact-match rule per row. After deploying, paste the old URLs into the bulk URL checker: every row should show one hop to the right page.

Do many redirect rules slow down my server?

Not noticeably for a few thousand exact-match rules. nginx and Caddy handle large lists efficiently, while Apache reads .htaccess on every request, so files with tens of thousands of lines can add a few milliseconds to each one. For lists that large, put the rules in the main server configuration or use your CDN's bulk redirects, which answer at the edge.

Should I use a 301 or a 302 redirect?

Use 301 (or 308) when the move is permanent: search engines transfer the old URL's signals to the new one. Use 302 or 307 only for temporary moves, such as a seasonal page that comes back. 307 and 308 keep the request method, which matters only for form posts and APIs. The generator writes 301 unless a row asks for another status.

Should I redirect every old page to the home page?

No. Google treats a redirect to an unrelated page as a soft 404 and ignores it, so the old page's links and rankings are lost anyway. Redirect each old URL to its closest equivalent, such as the new product, category or article, and let pages with no equivalent answer 404 or 410. Visitors also find what they came for instead of starting over.

My site runs WordPress. Where do the rules go?

On Apache hosting, at the top of .htaccess, above the # BEGIN WordPress block. On nginx hosting ask the host to add the map, or use a redirect plugin and import the list as CSV. Rules in the server run before WordPress loads, so they answer faster than a plugin and keep working if a plugin is switched off.

All 59 tools →

Free, funded by the people who use it

No account, no paid plan. Donations keep it running.

Chip in