Skip to main content
SerpGem
Technical SEO

Redirect Rule Generator

Generate production-ready redirect rules from URL pairs. Supports Apache .htaccess, Nginx, Next.js, Netlify, and Cloudflare Pages. Choose 301/302/307/308 and get copy-ready output.

How to use this tool3 quick steps
  1. Select your platform and redirect type

    301 is a permanent redirect — use it for site migrations and URL changes that should be indexed. 302 is temporary and won't transfer link equity.
  2. Enter old → new URL pairs

    From is the old path (/old-page or full URL). To is the new destination. You can add as many pairs as needed — they all compile into one output block.
  3. Copy the rules into your config

    For .htaccess paste into your Apache config. For Nginx add to your server block. For Cloudflare, Netlify, or Vercel paste into their respective config file.
InputRedirect rules

Platform

Redirect type

From (old URL)To (new URL)
OutputRedirect rules

Use this with

See all 9 tools

Redirect Guide

Redirect rules that preserve rankings

Redirects are one of the riskiest SEO operations if done wrong. A 302 where you needed a 301, a redirect chain that loses PageRank, a mismatch between HTTP and HTTPS versions — any of these can cause significant ranking drops. Get the syntax right the first time with generated rules.

301 vs 302: the most important choice

301 Permanent: passes ~90% of link equity to the destination. Use for any permanent URL change. 302 Temporary: passes little to no link equity. Google may continue indexing the original URL. Only use 302 for genuine temporary redirects (maintenance pages, A/B tests).

Redirect chains destroy PageRank

A→B→C loses more equity than A→C. Each hop in a redirect chain loses approximately 10-15% of link equity. If you've redirected URLs multiple times over the years, consolidate chains by pointing all old URLs directly to the final destination.

HTTP to HTTPS migration

A proper HTTPS migration requires a site-wide 301 from http:// to https://. Without it, you have two versions of your site and Google may index both, splitting PageRank. The .htaccess rule for this is different from individual URL redirects.

Trailing slash consistency

/page and /page/ are treated as different URLs by most servers. Pick one and redirect the other. Inconsistency creates duplicate content. Apache: "RewriteRule ^(.*)/$ /$1 [R=301,L]". Next.js: use the trailingSlash setting.

When to use 307/308

307 (Temporary) and 308 (Permanent) are HTTP 1.1 equivalents of 302/301 but with method preservation — the HTTP method (POST, PUT) is preserved through the redirect. Use when your API or form submissions need to redirect without method change.

Testing redirects before deploying

Use curl to verify: curl -I https://example.com/old-page. Check Location header for the destination, Status code for the type. A redirect chain shows as multiple Location responses. Test all redirects in staging before production deployment.

Pro Tips

Always use 301 for site migrations

Every URL that has backlinks should be 301 redirected. If you're not sure whether a URL has backlinks, 301 everything. The cost of a missed 301 (lost link equity) far outweighs the cost of an unnecessary one.

Redirect old content to closest match

Don't redirect deleted pages to the homepage unless there's genuinely no relevant page to send users to. Google can detect that /old-blog-post → /homepage is a soft 404 and will ignore the redirect. Point to the closest relevant page.

Keep your redirect list as documentation

The URL pairs you enter here are also a migration record. Save them in a spreadsheet alongside implementation dates. When you troubleshoot ranking drops months later, this history is invaluable.

?

Frequently Asked Questions

How many redirects can I create at once?
As many as you need — there's no limit in this tool. For very large migrations (1000+ redirects), test in batches of 50-100 and deploy incrementally. Monitor Search Console after each batch for coverage errors.
Which format should I choose?
Apache (.htaccess): shared hosting or Apache servers. Nginx: if your server uses Nginx. Next.js: Next.js projects (App Router or Pages). Netlify/Cloudflare Pages: if you deploy to these platforms (both use the same _redirects syntax).
Can I use wildcards (redirect all /blog/* to /articles/*)?
This tool generates exact URL-to-URL rules. For wildcard/pattern redirects, you need to write the RewriteRule manually. Apache pattern: 'RewriteRule ^blog/(.*)$ /articles/$1 [R=301,L]'. Next.js supports source with ':path*' wildcards.
Does the order of rules matter?
Yes for Apache. Rules are processed top-to-bottom and the first match wins. Put more specific rules before more general ones. Nginx is different — last match wins by default. Next.js processes in array order.