GeoPromptTracker

Free tool — no sign-up

Redirect Rules Generator

Redirect rules

Nothing yet — run the tool above.

Every site migration, URL restructure, or page consolidation leaves old URLs behind — and every old URL that 404s instead of redirecting bleeds traffic, breaks backlinks, and dead-ends the crawlers trying to reach your content. This tool converts a simple list of old→new pairs into deploy-ready rules in the four most common formats.

Why it matters for AI search: the classic case for redirects — preserving link equity and not breaking bookmarks — extends directly to AI systems. Models trained on data mentioning your old URLs, and AI search indexes that stored them, will keep trying those URLs long after you've moved the content. A 301 redirect means those references still resolve to your content and can be cited; a 404 means an AI assistant fetching your old URL comes back empty-handed and cites someone else. During any migration, redirects are how you carry your existing AI visibility over to the new structure.

How this tool works: add your redirect pairs — source path on the left, destination on the right — and toggle each between 301 (permanent) and 302 (temporary). The output panel generates all four formats simultaneously, one per tab: Apache .htaccess (Redirect 301 /old /new), nginx rewrite rules with correctly escaped regex characters, a complete next.config.js redirects() block for Next.js/Vercel, and Cloudflare Pages' _redirects file format. Copy from the tab that matches your hosting, or download the file directly.

Limitations: the generated rules are exact-match, one URL to one URL — pattern/wildcard redirects, query-string handling, and conditional logic (by country, device, or header) are platform-specific enough that no generic generator handles them well; use these rules as your starting scaffold and consult your platform's docs for pattern syntax. The tool also doesn't verify your destination URLs exist or check for redirect chains (A→B→C) — after deploying, spot-check a few old URLs manually and keep chains to a single hop, since both crawlers and users pay for every extra redirect in the chain.

Frequently asked questions

When should I use a 301 vs a 302 redirect?

301 (permanent) tells crawlers the old URL is gone for good and its authority should transfer to the new one — use it for migrations, renamed pages, and consolidations. 302 (temporary) preserves the old URL's standing — use it only when the move genuinely is temporary, like A/B tests or short-lived campaign swaps.

Which output format do I need?

It depends where your site is hosted: .htaccess for Apache shared hosting, nginx config for VPS/self-hosted nginx servers, next.config.js redirects for Next.js/Vercel apps, and the _redirects file for Cloudflare Pages.

Do redirects matter for AI search visibility?

Yes — AI crawlers follow redirects like any other crawler. Broken old URLs that 404 instead of redirecting mean lost citations: an AI system that learned or indexed your old URL hits a dead end instead of your content.

Can I redirect to a different domain?

Yes — use a full absolute URL (https://newdomain.com/path) as the destination. All four output formats support cross-domain targets.

Does this tool support wildcard or pattern redirects?

It generates exact-match, one-to-one rules. For pattern-based redirects (like /blog/* → /articles/*), start from this output and add the wildcard syntax your platform uses — the syntax differs significantly between Apache, nginx, and Next.js.

Related