RewriteOptionsExtensions.AddRewrite 方法

定义

如果正则表达式与 HttpContext 的 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

参数

regex
String

要与之比较的正则表达式字符串。

replacement
String

如果正则表达式匹配,则用于替换 uri 的内容。

skipRemainingRules
Boolean

如果正则表达式匹配,则有条件地停止处理其他规则。

返回

重写选项。

适用于