---
title: "redirect"
sidebar_label: "redirect"
description: "Kotlin binding reference: redirect."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../../index.md)/[io.clika.runtime](../../index.md)/[ServerResponse](../index.md)/[Companion](index.md)/[redirect](redirect.md)

# redirect

[common]\
fun [redirect](redirect.md)(location: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), status: [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) = 302): [ServerResponse](../index.md)

A redirect to [location](redirect.md) (emitted verbatim: validate it before building it from request input).