You've already forked AstralRinth
forked from didirus/AstralRinth
Refactor search page, migrate to /discover/ (#4862)
This commit is contained in:
13
apps/frontend/src/middleware/search-redirect.global.ts
Normal file
13
apps/frontend/src/middleware/search-redirect.global.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
export default defineNuxtRouteMiddleware((to) => {
|
||||
if (
|
||||
to.path.startsWith('/mods') ||
|
||||
to.path.startsWith('/modpacks') ||
|
||||
to.path.startsWith('/plugins') ||
|
||||
to.path.startsWith('/datapacks') ||
|
||||
to.path.startsWith('/resourcepacks') ||
|
||||
to.path.startsWith('/shaders')
|
||||
) {
|
||||
const target = '/discover' + to.fullPath
|
||||
return navigateTo(target, { redirectCode: 301 })
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user