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 4 stars 0 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 83/100

Stars 20%
23
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
6 months ago
Last Updated
yesterday
Language
HTML
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

Web & Frontend Solid

nextjs-seo

Next.js App Router SEO optimization and auditing. Use when implementing or fixing SEO in a Next.js app — metadata and generateMetadata, viewport/themeColor, Open Graph and og/twitter images (file conventions + ImageResponse), web app manifest, favicons/icons, sitemap.xml, robots.txt, canonical URLs, hreflang/i18n alternates, JSON-LD structured data and rich results, Core Web Vitals (LCP/INP/CLS), AI search/GEO and AI crawler rules (GPTBot, OAI-SearchBot), or diagnosing Google indexing problems (Search Console, "Discovered/Crawled - currently not indexed"). Also use to run an SEO audit checklist. Not for general Next.js feature work unrelated to SEO.

62 Updated 1 weeks ago
laguagu
Web & Frontend Listed

nextjs-seo

Implement SEO correctly in a Next.js App Router or Pages Router codebase — metadata, canonicals, sitemaps, robots, Open Graph images, structured data, and rendering strategy. Use whenever the user is working in a Next.js project and mentions SEO, metadata, generateMetadata, sitemap.ts, robots.ts, canonical URLs, Open Graph, og:image, JSON-LD, indexing, or asks why Next.js pages aren't ranking or showing correct previews. Also use when reviewing a Next.js marketing site, blog or docs site before launch.

0 Updated 3 days ago
keupera
Web & Frontend Listed

nextjs-security

Find Next.js-specific security issues across App Router, Pages Router, and Server Actions. Covers the middleware-bypass class, NEXT_PUBLIC environment leakage, RSC over-fetch, CSP for App Router, open redirects, and next/image SSRF via permissive remotePatterns. Invoke when reviewing a Next.js app before launch, after a major version upgrade, or when adding authenticated routes.

17 Updated 1 months ago
GoldenWing-360