---
title: "redirect"
description: "Elysia API reference for redirect."
url: "https://next.elysiajs.com/reference/variables/redirect/"
---

# redirect

```ts
const redirect: (url, status?) => Response;
```

Defined in: elysia/dist/utils.d.ts:124

## Parameters

| Parameter | Type                                      | Description        |
| --------- | ----------------------------------------- | ------------------ |
| `url`     | `string`                                  | URL to redirect to |
| `status?` | `301` \| `302` \| `303` \| `307` \| `308` | -                  |

## Returns

`Response`
