# SvelteKit redirects

> Use SvelteKit’s server-side redirect helper for moved routes, choose a status based on whether the move is permanent, and verify the deployed response.

Canonical: https://scaplet.com/seo/sveltekit/redirects

Guide SvelteKit · URL changes

Use SvelteKit’s server-side redirect helper for moved routes, choose a status based on whether the move is permanent, and verify the deployed response.

3 min

read

6

sources

Oct 24, 2026

updated

Scaplet Editorial Team

author

In one line

In SvelteKit, import `redirect` from `@sveltejs/kit` and call it during request handling, for example in a server `load` function. Use 308 when the URL has moved for good, and 307 when it may return. Don't catch the thrown redirect, and check the deployed response for the expected status and `Location`.

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fsveltekit%2Fredirects%20(%22SvelteKit%20redirects%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fsveltekit%2Fredirects%20(%22SvelteKit%20redirects%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fsveltekit%2Fredirects%20(%22SvelteKit%20redirects%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fsveltekit%2Fredirects%20(%22SvelteKit%20redirects%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 3 parts, 3 minutes.

1. [Redirect from server-side request handling 01](#redirect-from-server-side-request-handling)
2. [Choose a status that matches the change 02](#choose-a-status-that-matches-the-change)
3. [Test the production result 03](#test-the-production-result)

_01_Checklist

## Redirect from server-side request handling

SvelteKit’s docs say that when `redirect` is called during request handling, SvelteKit returns a redirect response, and that you must make sure you are not catching the thrown redirect. In `load` functions, don’t call it inside a `try {...}` block, because the redirect will immediately trigger the catch statement. Since SvelteKit 2 you call `redirect(...)` directly and don’t `throw` it. The example uses 308 for a permanent path change; use a real old-to-new map rather than deriving a destination from untrusted input.

1. 01 Use 301 or 308 for a permanent move. SvelteKit’s docs say a 308 keeps the request method and that “SEO will be transferred to the new page”. Google lists both 301 and 308 as permanent redirects, which show the new target in [search results](/glossary/serp).
2. 02 Use 302 or 307 for a temporary move. SvelteKit’s docs say 307 keeps the request method. Google says temporary redirects show the source page in search results.
3. 03 Use 303 to redirect as a GET request, often after a form POST. Google groups 303 with the temporary redirects.
4. 04 For an external destination, SvelteKit 3 requires the `external` option, either `true` or an array of allowed origins, for example `redirect(307, 'https://example.com', { external: true })`. Prefer the array of allowed origins when you know the destinations.

src/routes/old-guide/+page.server.ts

```
import { redirect } from '@sveltejs/kit' import type { PageServerLoad } from './$types' export const load: PageServerLoad = () => { redirect(308, '/guides/current-guide') }
```

_02_SvelteKit redirect status by job

## Choose a status that matches the change

Situation

### Permanent page move

Status

308 (or 301)

Why

Signals that the new URL replaces the old one

Situation

### Temporary maintenance or experiment

Status

307 (or 302)

Why

Keeps the move temporary

Situation

### After a successful form submission

Status

303

Why

Makes the follow-up request a GET

Situation

### Deleted page with no replacement

Status

No redirect; return a true not-found or gone response

Why

Avoid sending visitors to irrelevant content

**Static hosting needs a redirect layer**The `redirect` helper runs during request handling. SvelteKit’s adapter API exposes a map of redirects encountered during [prerendering](/glossary/speculation-rules), so an adapter can act on them. If you deploy with `adapter-static`, SvelteKit does not document emitting HTTP redirect responses for you, so confirm the status with `curl -I` and add redirects at your host if the response is wrong.

For an A/B test that redirects users to a variation URL, Google says to use a 302 (temporary) redirect, not a 301. Keep a redirect inventory with source, target, reason, status, and owner so future migrations do not add competing rules.

_03_How it works

## Test the production result

1. 1

### Request the old URL

Use `curl -I https://example.com/old-path` against the deployed site and inspect the status and `Location` header.
2. 2

### Follow the redirect

Use `curl -IL` to check every hop. The chain should end at a successful page, not a loop or another redirect.
3. 3

### Check the destination

Confirm it is the intended page, has a self-consistent canonical, and returns the expected language or path variant.
4. 4

### Update links and sitemap

Change [internal links](/glossary/internal-links) and sitemap entries to the final URL so visitors and crawlers do not repeatedly traverse old paths.

For related URL signals, read [canonical URLs](/glossary/canonical-url), [redirect chains](/seo-issues/redirect-chains), and [301 redirects](/glossary/301-redirect). A redirect status can be lost when a reverse proxy, CDN rule, or static hosting configuration overrides the framework output, so capture response headers from the public domain after each deployment.

Sources · 6

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- svelte.dev
- google.com

1. 01 [Load functions: Redirects | SvelteKit Docs](https://svelte.dev/docs/kit/load) svelte.dev · checked 2026-10-24
2. 02 [@sveltejs/kit: redirect | SvelteKit Docs](https://svelte.dev/docs/kit/@sveltejs-kit) svelte.dev · checked 2026-10-24
3. 03 [Migrating to SvelteKit v3: external redirects | Svelte Docs](https://svelte.dev/docs/kit/migrating-to-sveltekit-3) svelte.dev · checked 2026-10-24
4. 04 [Migrating to SvelteKit v2: redirect and error are no longer thrown by you | Svelte Docs](https://svelte.dev/docs/kit/migrating-to-sveltekit-2) svelte.dev · checked 2026-10-24
5. 05 [Redirects and Google Search | Google Search Central](https://developers.google.com/search/docs/crawling-indexing/301-redirects) developers.google.com · checked 2026-10-24
6. 06 [Website testing and Google Search | Google Search Central](https://developers.google.com/search/docs/crawling-indexing/website-testing) developers.google.com · checked 2026-10-24

Questions

## Asked a lot.

3 questions people ask next, answered from the sources on this page.

_01_ How do I redirect a route in SvelteKit?

Import `redirect` from `@sveltejs/kit` and call it in a server `load` function, for example `redirect(308, '/new-path')`. SvelteKit handles the thrown redirect as long as you don’t catch it.

_02_ Should I use 301 or 308 in SvelteKit?

Google treats both as permanent. SvelteKit’s docs list 308 as a common code that keeps the request method; 301 is also accepted by `redirect`. Test the deployed response either way.

_03_ Can SvelteKit redirects work on a static site?

A static file cannot run `redirect` per request. SvelteKit’s adapter API exposes redirects found during prerendering, but check what your adapter does and verify the response with `curl -I`.

## Keep learning

[All platform guides](/seo)

[Learn Gatsby redirects Frameworks](/seo/gatsby/redirects) [Related Canonical URL Crawling and indexing](/glossary/canonical-url) [Read next SvelteKit title tags and meta descriptions Frameworks](/seo/sveltekit/title-and-meta) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in platform guides
[Strapi hreflang](/seo/strapi/hreflang) [Strapi title and meta](/seo/strapi/title-and-meta) [Webflow SEO](/seo/webflow)

More in Frameworks
[SvelteKit redirects](/seo/sveltekit/redirects) [SvelteKit title tags and meta descriptions](/seo/sveltekit/title-and-meta)

Terms on this page
[SERP](/glossary/serp) [Speculation rules](/glossary/speculation-rules) [Internal links](/glossary/internal-links) [Canonical URL](/glossary/canonical-url) [301 redirect](/glossary/301-redirect)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
