共用方式為


RewriteOptionsExtensions.AddRewrite 方法

定義

如果 RegEx 符合 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

要與 比較的 RegEx 字串。

replacement
String

如果 RegEx 相符,則要取代 URI 的內容。

skipRemainingRules
Boolean

如果 RegEx 相符,請有條件地停止處理其他規則。

傳回

重寫選項。

適用於