A single dynamic route at a domain root needs two settings to avoid soft 404s
The munchable.app site serves 461 question-style pages, such as ones about low-FODMAP status of ingredients, directly from the domain root under one dynamic route. Without extra configuration, that route would render content for any unmatched path, turning typos into indexable soft 404s that can dilute search performance. The author fixes this with two exports, dynamicParams set to false and dynamic set to error, along with generateStaticParams, so only pre-generated slugs resolve and everything else returns a true 404. Curl output from the live site confirms that real answer pages return 200 while fake-looking URLs return a cached 404. The pages are generated at build time from ingredient data rather than stored as manual content files.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in