Share via


Results.Redirect(String, Boolean, Boolean) Method

Definition

Redirects to the specified url.

public static Microsoft.AspNetCore.Http.IResult Redirect (string url, bool permanent = false, bool preserveMethod = false);
static member Redirect : string * bool * bool -> Microsoft.AspNetCore.Http.IResult
Public Shared Function Redirect (url As String, Optional permanent As Boolean = false, Optional preserveMethod As Boolean = false) As IResult

Parameters

url
String

The URL to redirect to.

permanent
Boolean

Specifies whether the redirect should be permanent (301) or temporary (302).

preserveMethod
Boolean

If set to true, make the temporary redirect (307) or permanent redirect (308) preserve the initial request method.

Returns

The created IResult for the response.

Applies to