SEO

seo/http-status

Missing pages return 404 or 410, moved pages 301 or 308, and a client-rendered error view is not served with 200.

umiarkowanaw przeglądarcefe-seo-metadata

Dlaczego

A "Page not found" view returned with status 200 is a soft 404: search engines may index the error page or keep a dead URL in results. Temporary redirects for permanent moves split ranking signals between the old and new URL.

Poprawka

Return the real status from the server or the framework (Next.js notFound(), Nuxt createError({ statusCode: 404 }), SvelteKit error(404), Astro return new Response(null, { status: 404 })). In a client-only app, redirect unknown routes to a URL the server answers with 404, or add <meta name="robots" content="noindex"> to the error view. Use 301 or 308 for permanent moves.

Przykłady

// Next.js App Router
import { notFound } from 'next/navigation'
if (!product) notFound()

Źródła

Fakty

Identyfikator
seo/http-status
Waga
umiarkowana
Sprawdzanie
w przeglądarce wymaga wyrenderowanej strony: audit --url
Dotyczy plików
page
Ten sam problem w
Lighthouse http-status-code
Uczy jej skill
fe-seo-metadata SEO and metadata
Od wersji
0.1.0

Plik reguły na GitHubie

Przeczytaj w terminalu

npx github:dawidolko/frontend-skills explain seo/http-status