Skip to content

Conversation

benmccann
Copy link
Member

No description provided.

Copy link

vercel bot commented Oct 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
omnisite ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 22, 2024 6:35pm
svelte-dev 🔄 Building (Inspect) Visit Preview 💬 Add feedback Oct 22, 2024 6:35pm

@Rich-Harris
Copy link
Member

Rather than adding a whole SvelteKit app, what if we just had a vercel.json with some redirect rules? The redirects will be much quicker if the Vercel proxy can take care of them without needing to run our code

@benmccann
Copy link
Member Author

makes sense. according to the docs, this should work:

export default {
	async redirects() {
		return [
			{
				source: '/docs/:slug',
				destination: 'https://svelte.dev/docs/kit/:slug',
				permanent: true,
			},
			{
				source: '/:slug',
				destination: 'https://svelte.dev',
				permanent: true,
			}
		];
	}
};

though I'm not sure where to put such a thing. Do I switch to adapter-vercel and check it in here or do we just paste it into the Vercel web UI somewhere?

@dummdidumm
Copy link
Member

you put it in the root of the redirect app (honestly unsure if you need anything at all besides that)

@Rich-Harris
Copy link
Member

If we can use vercel.json that would be better https://vercel.com/docs/projects/project-configuration#redirects

@Rich-Harris
Copy link
Member

lemme try out a test project real quick

@dummdidumm
Copy link
Member

dummdidumm commented Oct 22, 2024

Confident that we can just put up a vercel.json, which would be neat cause that means we can use that for kit.svelte.dev, learn.svelte.dev and the old omnisite (as shown in #535). Only preview site cannot use it because of the hashes.

@Rich-Harris
Copy link
Member

Yeah, I just tried it out and it works, will open a PR

@benmccann
Copy link
Member Author

awesome. thanks!

@benmccann benmccann closed this Oct 22, 2024
@benmccann benmccann deleted the kit-redirects branch October 22, 2024 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants