FIRST CH TOOLS / SEO & AI / 48 REDIRECT GENERATOR
Redirect Rule Generator
When a redesign or a move changes your URLs, paste the old → new table and get 301 redirects for .htaccess (Apache), nginx and the Netlify _redirects file. Canonical www, HTTPS and trailing slashes come from presets, and duplicated source URLs, self-referencing loops and two-hop chains are flagged as you paste.
1 — Old URL → new URL
2 — Site-wide presets
The presets are written above the per-URL rules, so the host and scheme are corrected first and the path swap costs a single hop.
3 — Output
The table never leaves your browser — parsing and generation both run on this page. Settings can be passed in the URL: /en/redirect/?format=nginx&domain=example.com&www=none&https=1&slash=add / with the table itself: /en/redirect/?pairs=/old.html,/new/;/a.html,/b/ (; separates rows, , separates columns).
How to Use
- Paste the tableCopy the two columns of old and new URLs from your spreadsheet. Exporting the old URLs from a crawl or the old sitemap first is the reliable way to avoid gaps.
- Pick the presetsDecide where www, HTTPS and trailing slashes should land. For a whole-site move, fill in the domain and the host rules are written above the per-URL rules.
- Put it on the serverApache: drop .htaccess in the document root. nginx: check with nginx -t, then reload. Netlify / Cloudflare Pages: put _redirects in the publish directory and deploy.
About This Tool
The most expensive part of a relaunch is the redirects nobody wrote. If the URLs change and the old ones start returning 404, search traffic, the value of links other sites have pointed at you, and everybody's bookmarks stop working on the same day. A 301 tells search engines the page moved for good: the index is rewritten and most of the link equity follows. Because it has to be live on launch day, the mapping table is built alongside the build, not after it.
One table, three syntaxes. Apache (mod_rewrite in .htaccess), nginx (location or a map) and Netlify / Cloudflare Pages (_redirects) say the same thing in entirely different ways. Build the table before the hosting decision is final and switching is one tab. Old URLs with a query string (?id=42) are handled in each syntax's own idiom: RewriteCond %{QUERY_STRING} for Apache, a $request_uri map for nginx, and conditions after the path for Netlify.
The mistakes in a hand-written table are caught as you paste. The same source URL twice (only the first rule runs), a URL pointing at itself (an infinite loop), A→B and B→C both present (it should be A→C), a missing leading /, spaces or non-ASCII characters left unencoded — all of them appear, with counts, under “What was read”.
After launch, check in Search Console that the old URLs are reported as 301. For crawl permissions see the robots.txt generator, for AI guidance the llms.txt generator, and for tidying query strings the URL parameter editor.
Redirect pitfalls
Do not send everything to the home page
RewriteRule ^(.*)$ / [R=301,L] ← everything to the top (treated as a 404)
Pointing every old URL at the home page to avoid writing a table is treated by Google as a soft 404, and no ranking is carried over. It does not help visitors either: they wanted an article and got the front door. Map one old URL to the closest matching new page, and let the pages with no successor return an honest 404 (or 410).
Chains cost speed and equity
/old.html → /new.html → /new/ → https://example.com/new/ ← four round trips
Writing “http to https”, “www to no-www”, “old path to new path” and “add the slash” as separate rules makes one request bounce several times. On mobile every hop is felt, and Google may stop following a long chain. That is why the host and scheme rules are placed above the per-URL rules here — and why the new URLs in your table should already be in their final form (right scheme, right host, right slash).
Browsers cache a 301 hard
301 Moved Permanently ← remembered by the browser; you cannot undo it remotely 302 Found ← use this while testing
Once a browser has seen a 301 it goes straight to the new URL without asking the server. Ship a wrong rule and it keeps running on your visitors' machines after you fix it (only clearing their cache helps). While you are unsure, test with a 302 and switch to 301 once the mapping is confirmed.
.htaccess is read line by line, on every request
RewriteRule ^a/1$ /x/ [R=301,L] RewriteRule ^a/2$ /x/ [R=301,L] … (hundreds of lines)
.htaccess is re-read on every request and the rules are evaluated top to bottom. Past a few hundred entries that becomes real load: use an nginx map (a single hash lookup) or a redirect table inside the application. Even just moving the busiest URLs to the top helps.
With and without the trailing slash are different URLs
/about and /about/ ← two pages as far as a crawler is concerned
Serving the same content at both looks like duplication. Pick one and 301 the other to it. Adding a slash to a real file such as /index.html breaks it, so the “add” preset excludes files (Apache tests whether the file exists; nginx checks for an extension).
A query string is not part of the path
RewriteRule ^old\.php$ /new/ [R=301,L] ← nothing here looks at ?id=42
RewriteCond %{QUERY_STRING} ^id=42$ ← this is what makes it work
Legacy CMS URLs like /index.php?p=123 cannot be told apart by a path-only rule. Apache needs RewriteCond %{QUERY_STRING}; nginx needs $request_uri, which includes the query. The original query is also appended to the target unless you drop it — Apache does that with the QSD flag, which this tool adds automatically whenever a row carries a query.
You cannot drop the old domain after a year
https://old-company.com/* → https://new-company.com/:splat
After a domain move, keep the old registration and its TLS certificate alive for at least a year, preferably several, and keep serving the 301s: business cards, print and other people's links outlive any migration plan. Use the Change of Address tool in Search Console as well — it moves things along faster than the 301s alone.
Redirects are not an excuse to leave internal links broken
<a href="/company/about.html"> ← your own site still points at the old URL
It works, but every visitor pays an extra round trip. Redirects are a safety net for inbound links and bookmarks; your own navigation, sitemap, structured data and ad destinations should be rewritten to the new URLs.
Other Tools
- 01Batch Image → WebP ConverterWebP Converter
- 02White Background RemoverWhite BG Remover
- 03WCAG Contrast CheckerContrast Checker
- 04Character CounterCharacter Counter
- 05llms.txt Generatorllms.txt Generator
- 06JSON-LD GeneratorJSON-LD Generator
- 07Markdown → PDFMD → PDF
- 08OGP Meta Tag WizardOGP Wizard
- 09Favicon GeneratorFavicon Generator
- 10TikTok PublisherTikTok Publisher
- 11Encoding & Line Ending ConverterEncoding Converter
- 12Batch Image → AVIF ConverterAVIF Converter
- 13Test Data GeneratorTest Data Generator
- 14Marp Markdown → SlidesMarp Slides
- 15Text & Code Diff CheckerDiff Checker
- 16Cron Expression ExplainerCron Explainer
- 17Base64 & Data URI EncoderBase64 & Data URI
- 18URL Parameter Editor & UTM BuilderURL Parameters
- 19HTML Entity Escape & UnescapeHTML Escape
- 20JSON ⇄ YAML ConverterJSON ⇄ YAML
- 21PX ⇄ REM / EM ConverterPX ⇄ REM / EM 単位変換
- 22Color Converter & AlphaColorコード変換&アルファ透過
- 23MD5 / SHA-256 Hash Generatorハッシュ生成
- 24JWT Decoder & Expiry CheckerJWTデコーダー&有効期限チェッカー
- 25User-Agent ParserUser-Agent解析&デバイス判定
- 26UUID & ULID GeneratorUUID (v4) & ULID 一括生成
- 27Aspect Ratio Calculatorアスペクト比計算&サイズ算出
- 28Markdown Table & CSV/TSV ConverterMarkdownテーブル整形&CSV/TSV変換
- 29SQL Query FormatterSQLクエリフォーマッター&整形
- 30QR Code GeneratorQR Code Generator
- 31Regex Tester正規表現テスター
- 32Unix Timestamp ConverterUNIXタイムスタンプ⇄日時変換
- 33New Tab Memo新規タブメモ帳
- 34Image Resizer & Cropper画像リサイズ&クロップ
- 35EXIF Viewer & RemoverEXIF情報の確認&除去
- 36robots.txt Generatorrobots.txt ジェネレーター
- 37Password Generator安全なパスワード生成
- 38Case Converter文字列ケース変換
- 39CSV/TSV ⇄ JSON ConverterCSV/TSV ⇄ JSON 相互変換
- 40PDF Merge, Split & ExtractPDF結合・分割・ページ抽出
- 41Full-width ⇄ Half-width Converter全角⇄半角変換&テキストクリーナー
- 42X (Twitter) Post CounterX(Twitter)投稿の文字ウェイト計算
- 43CSS clamp() Fluid Typography CalculatorCSS clamp() 計算機
- 44CSS Gradient GeneratorCSSグラデーションジェネレーター
- 45Image Colour Palette Extractor画像からカラーパレット抽出
- 46QR Code ReaderQRコード読み取り
- 47SVG Optimizer & Data URISVG最適化&data URI化