RewriteOptionsExtensions.AddRedirect 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
AddRedirect(RewriteOptions, String, String) |
如果正则表达式与 HttpContext 的 PathString 匹配,则重定向请求 |
AddRedirect(RewriteOptions, String, String, Int32) |
如果正则表达式与 HttpContext 的 PathString 匹配,则重定向请求 |
AddRedirect(RewriteOptions, String, String)
- Source:
- RewriteOptionsExtensions.cs
- Source:
- RewriteOptionsExtensions.cs
- Source:
- RewriteOptionsExtensions.cs
如果正则表达式与 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
要与之比较的正则表达式字符串。
- replacement
- String
如果正则表达式匹配,则用什么替换 uri。
返回
重写选项。
适用于
AddRedirect(RewriteOptions, String, String, Int32)
- Source:
- RewriteOptionsExtensions.cs
- Source:
- RewriteOptionsExtensions.cs
- Source:
- RewriteOptionsExtensions.cs
如果正则表达式与 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
要与之比较的正则表达式字符串。
- replacement
- String
如果正则表达式匹配,则用什么替换 uri。
- statusCode
- Int32
要添加到响应的状态代码。
返回
重写选项。