Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
fullstack ruleP1project specificStack: node
nextjswebviewhttprouting
Return 404 instead of a redirect for embedded/web-view routes
For routes loaded in a native app web view, return notFound rather than a redirect so the app can react instead of rendering a full redirected page.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetypescript
| 1 | return { redirect: { destination: '/ticker/x/owners', permanent: false } }; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | return { notFound: true }; |
Explanation (EN)
Objašnjenje (HR)