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 ruleP1universalStack: Next.js
routingseoredirectsbackwards-compat
Add a redirect when removing or renaming a public route
When you remove a URL path, add a permanent redirect to its replacement so bookmarked/indexed links keep working.
PR: hegnar-forum-web · org-mining-3rd-2026-06Created: Jun 18, 2026
Bad example
Old codets
| 1 | // /estimater route deleted, old bookmarks now 404 |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | if (tab === 'estimater') { |
| 2 | return permanentRedirect(`/ticker/${fullName}/pinpoint`); |
| 3 | } |
Explanation (EN)
Objašnjenje (HR)