use base in 404 redirect
This commit is contained in:
parent
cbb6920ebf
commit
a3f692f969
2 changed files with 4 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
<script lang="ts">
|
||||
import { browser } from '$app/environment';
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { _, locale } from 'svelte-i18n';
|
||||
|
||||
export let path: string;
|
||||
|
@ -22,7 +23,7 @@
|
|||
if (modules.hasOwnProperty(`/src/lib/docs/${$locale}/${path}`)) {
|
||||
loadModule(`/src/lib/docs/${$locale}/${path}`);
|
||||
} else if (browser) {
|
||||
goto(`/404`);
|
||||
goto(`${base}/404`);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
import { languages } from '$lib/languages';
|
||||
import { browser } from '$app/environment';
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
|
||||
$: if ($page.params.language === '' && $locale !== 'en') {
|
||||
locale.set('en');
|
||||
|
@ -18,7 +19,7 @@
|
|||
if (languages.hasOwnProperty(lang)) {
|
||||
locale.set(lang);
|
||||
} else if (browser) {
|
||||
goto('/404');
|
||||
goto(`${base}/404`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue