Files
BRETT/app/middleware/thread-redirect.global.ts
T
FliesentischKingandDevin 456776ea68 Shorten thread route from /thread to /t
All internal links (tiles, prev/next nav, comments, notifications,
breadcrumb, dropzone route check) point to /t/<id>. A global route
middleware permanently redirects old /thread/<id> URLs including
query string and comment anchor.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-04 15:24:32 +02:00

7 lines
294 B
TypeScript

// Alter Thread-Pfad — /thread/<id> leitet dauerhaft auf /t/<id> um
export default defineNuxtRouteMiddleware((to) => {
if (to.path.startsWith('/thread/')) {
return navigateTo({ path: to.path.replace(/^\/thread\//, '/t/'), query: to.query, hash: to.hash }, { redirectCode: 301 })
}
})