Share via


RewriteOptionsExtensions.AddRedirect Method

Definition

Overloads

AddRedirect(RewriteOptions, String, String)

Redirect the request if the regex matches the HttpContext's PathString

AddRedirect(RewriteOptions, String, String, Int32)

Redirect the request if the regex matches the HttpContext's PathString

AddRedirect(RewriteOptions, String, String)

Source:
RewriteOptionsExtensions.cs
Source:
RewriteOptionsExtensions.cs
Source:
RewriteOptionsExtensions.cs

Redirect the request if the regex matches the HttpContext's PathString

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Rewrite::RewriteOptions ^ AddRedirect(Microsoft::AspNetCore::Rewrite::RewriteOptions ^ options, System::String ^ regex, System::String ^ replacement);
public static Microsoft.AspNetCore.Rewrite.RewriteOptions AddRedirect (this Microsoft.AspNetCore.Rewrite.RewriteOptions options, string regex, string replacement);
static member AddRedirect : Microsoft.AspNetCore.Rewrite.RewriteOptions * string * string -> Microsoft.AspNetCore.Rewrite.RewriteOptions
<Extension()>
Public Function AddRedirect (options As RewriteOptions, regex As String, replacement As String) As RewriteOptions

Parameters

regex
String

The regex string to compare with.

replacement
String

If the regex matches, what to replace the uri with.

Returns

The Rewrite options.

Applies to

AddRedirect(RewriteOptions, String, String, Int32)

Source:
RewriteOptionsExtensions.cs
Source:
RewriteOptionsExtensions.cs
Source:
RewriteOptionsExtensions.cs

Redirect the request if the regex matches the HttpContext's PathString

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Rewrite::RewriteOptions ^ AddRedirect(Microsoft::AspNetCore::Rewrite::RewriteOptions ^ options, System::String ^ regex, System::String ^ replacement, int statusCode);
public static Microsoft.AspNetCore.Rewrite.RewriteOptions AddRedirect (this Microsoft.AspNetCore.Rewrite.RewriteOptions options, string regex, string replacement, int statusCode);
static member AddRedirect : Microsoft.AspNetCore.Rewrite.RewriteOptions * string * string * int -> Microsoft.AspNetCore.Rewrite.RewriteOptions
<Extension()>
Public Function AddRedirect (options As RewriteOptions, regex As String, replacement As String, statusCode As Integer) As RewriteOptions

Parameters

regex
String

The regex string to compare with.

replacement
String

If the regex matches, what to replace the uri with.

statusCode
Int32

The status code to add to the response.

Returns

The Rewrite options.

Applies to