共用方式為


RewriteOptionsExtensions.AddRedirect 方法

定義

多載

AddRedirect(RewriteOptions, String, String)

如果 RegEx 符合 HttpCoNtext 的 PathString,重新導向要求

AddRedirect(RewriteOptions, String, String, Int32)

如果 RegEx 符合 HttpCoNtext 的 PathString,重新導向要求

AddRedirect(RewriteOptions, String, String)

來源:
RewriteOptionsExtensions.cs
來源:
RewriteOptionsExtensions.cs
來源:
RewriteOptionsExtensions.cs

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

參數

regex
String

要與 比較的 RegEx 字串。

replacement
String

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

傳回

重寫選項。

適用於

AddRedirect(RewriteOptions, String, String, Int32)

來源:
RewriteOptionsExtensions.cs
來源:
RewriteOptionsExtensions.cs
來源:
RewriteOptionsExtensions.cs

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

參數

regex
String

要與 比較的 RegEx 字串。

replacement
String

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

statusCode
Int32

要新增至回應的狀態碼。

傳回

重寫選項。

適用於