Share via


RewriteOptionsExtensions.AddRewrite Method

Definition

Adds a rule that rewrites the path if the regex matches the HttpContext's PathString.

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

Parameters

regex
String

The regex string to compare with.

replacement
String

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

skipRemainingRules
Boolean

If the regex matches, conditionally stop processing other rules.

Returns

The Rewrite options.

Applies to