RewriteOptionsExtensions.AddRedirect 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
AddRedirect(RewriteOptions, String, String) |
如果 RegEx 符合 HttpCoNtext 的 PathString,重新導向要求 |
AddRedirect(RewriteOptions, String, String, Int32) |
如果 RegEx 符合 HttpCoNtext 的 PathString,重新導向要求 |
AddRedirect(RewriteOptions, String, String)
如果 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
參數
- options
- RewriteOptions
- regex
- String
要與 比較的 RegEx 字串。
- replacement
- String
如果 RegEx 相符,則要取代 URI 的內容。
傳回
重寫選項。
適用於
AddRedirect(RewriteOptions, String, String, Int32)
如果 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
參數
- options
- RewriteOptions
- regex
- String
要與 比較的 RegEx 字串。
- replacement
- String
如果 RegEx 相符,則要取代 URI 的內容。
- statusCode
- Int32
要新增至回應的狀態碼。
傳回
重寫選項。