nextjs-i18n-seo

Solid

Audit/fix Next.js i18n SEO for the App Router — crawlability, 307→301 redirects, locale URLs, sitemap, hreflang. Use when diagnosing lost PageRank or i18n redirect bugs in middleware.

Web & Frontend 3 stars 0 forks Updated 4 days ago MIT

Install

View on GitHub

Quality Score: 82/100

Stars 20%
20
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Next.js i18n SEO Fix Multilingual Next.js sites commonly ship with a crawlability-killing bug: locale redirects that use **307 Temporary** instead of **301 Permanent**. This means Googlebot never transfers PageRank to the actual indexed URL. Fix this first — it's a one-line change with immediate impact. ## The Core Problem When a user (or Googlebot) hits `/hexagrams/14`, Next.js middleware redirects to `/en/hexagrams/14`. The default `NextResponse.redirect(url)` issues a **307 Temporary Redirect**. Google does not transfer PageRank on 307s. Result: any backlink to the clean URL is wasted. **Pages Router** doesn't have this problem because `getStaticPaths` generates pages at their final URL with no redirect hop. --- ## Phase 1: Audit the Site ### 1. Check the redirect status code ```bash curl -I https://example.com/some-page # Look for: Location: and HTTP/2 301 vs 307 ``` ### 2. Check robots.txt ``` https://example.com/robots.txt ``` - All paths should be allowed (or only `/api/` blocked) - Sitemap URL must be listed ### 3. Check the sitemap ``` https://example.com/sitemap.xml ``` - Are all pages listed with their final (locale-prefixed) URL? - Are `alternates.languages` hreflang entries present? ### 4. Inspect the middleware Look for `NextResponse.redirect(url)` — if no status code is passed, it's a 307. --- ## Phase 2: Fix the 307 → 301 Bug **File: `src/middleware.ts`** (or `middleware.ts` at root) ```ts // ❌ BEFORE — issues 307 Temporary Redirect const respo...

Details

Author
augchan42
Repository
augchan42/inkstone
Created
5 months ago
Last Updated
4 days ago
Language
HTML
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

Web & Frontend Listed

nextjs-locale-standalone

Add locale-prefixed i18n routing to a single (non-monorepo) Next.js App Router site — a middleware/proxy that redirects `/` and any unprefixed path to `/<locale>/…` using the locale toggle's last choice (the NEXT_LOCALE cookie) then the browser's Accept-Language, a `[locale]` layout with a LocaleProvider + hooks, and a LocaleToggle that persists the choice. Use when adding bilingual/multilingual routing to a standalone Next.js site, building `/en-hk/…` `/zh-hk/…` URL namespaces, redirecting the root to a default-or-remembered locale, persisting a language switch across visits, or detecting browser language in middleware. For a monorepo that shares this logic across several apps via a workspace package, use nextjs-locale-monorepo instead.

2 Updated 1 weeks ago
stealth-engine
AI & Automation Listed

30x-seo-redirects

Redirect chain audit and analysis. Detects redirect loops, long chains, mixed protocols, and orphaned redirects. Use when user says "redirect audit", "301 redirect", "redirect chain", "redirect loop", or "migration redirects".

0 Updated today
square-lupus579
Code & Development Solid

seo-fix

Apply fixes from seo-audit findings. Reads audit JSON, classifies fixes by safety tier (SAFE/MODERATE/DANGEROUS), applies templates per framework. Supports Astro, Next.js, Hugo. Modes: default (SAFE only), --auto (SAFE+MODERATE), --all (all tiers, requires confirmation), --dry-run, --finding F1,F3, --fix-type sitemap-add,robots-fix,schema-cleanup.

6 Updated today
greglas75