Create +page.js

This commit is contained in:
freearhey 2023-10-10 05:36:07 +03:00
parent e2e50a493d
commit 46c3780592

View file

@ -0,0 +1,9 @@
import { redirect } from '@sveltejs/kit'
export function load({ url }) {
const id = url.searchParams.get('id')
const [name, country] = id.split('.')
const redirectUrl = `/channels/${country}/${name}`
throw redirect(302, redirectUrl)
}