Skip to content

Commit f519509

Browse files
committed
fix(redirects): support no-prefix strategy in redirect handling
1 parent 5578bc0 commit f519509

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/runtime/plugins/03.define.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ export default defineNuxtPlugin(async (nuxtApp) => {
6262
}
6363

6464
if (import.meta.server) {
65-
if (isPrefixStrategy(i18nConfig.strategy!)) {
65+
if (isPrefixStrategy(i18nConfig.strategy!) || isNoPrefixStrategy(i18nConfig.strategy!)) {
6666
await handleRedirect(route)
6767
}
6868
}
6969

7070
router.beforeEach(async (to, from, next) => {
71-
if (isPrefixStrategy(i18nConfig.strategy!)) {
71+
if (isPrefixStrategy(i18nConfig.strategy!) || isNoPrefixStrategy(i18nConfig.strategy!)) {
7272
await handleRedirect(to)
7373
}
7474
if (next) {

0 commit comments

Comments
 (0)