HttpResponse.RedirectPermanent HttpResponse.RedirectPermanent HttpResponse.RedirectPermanent HttpResponse.RedirectPermanent Method

定义

执行从所请求 URL 到所指定 URL 的永久重定向。Performs a permanent redirection from a requested URL to a specified URL.

重载

RedirectPermanent(String, Boolean) RedirectPermanent(String, Boolean) RedirectPermanent(String, Boolean) RedirectPermanent(String, Boolean)

执行从所请求 URL 到所指定 URL 的永久重定向,并提供用于完成响应的选项。Performs a permanent redirection from the requested URL to the specified URL, and provides the option to complete the response.

RedirectPermanent(String) RedirectPermanent(String) RedirectPermanent(String) RedirectPermanent(String)

执行从所请求 URL 到所指定 URL 的永久重定向。Performs a permanent redirection from the requested URL to the specified URL.

RedirectPermanent(String, Boolean) RedirectPermanent(String, Boolean) RedirectPermanent(String, Boolean) RedirectPermanent(String, Boolean)

执行从所请求 URL 到所指定 URL 的永久重定向,并提供用于完成响应的选项。Performs a permanent redirection from the requested URL to the specified URL, and provides the option to complete the response.

public:
 void RedirectPermanent(System::String ^ url, bool endResponse);
public void RedirectPermanent (string url, bool endResponse);
member this.RedirectPermanent : string * bool -> unit
Public Sub RedirectPermanent (url As String, endResponse As Boolean)

参数

url
String String String String

要将请求重定向至的位置。The location to redirect the request to.

endResponse
Boolean Boolean Boolean Boolean

若为 true,则终止响应;否则为 falsetrue to terminate the response; otherwise false. 默认值为 falseThe default is false.

异常

url 包括一个换行符 (\n)。url includes a newline character (\n).

注解

RedirectPermanent(String, Boolean)方法重载在响应中提供 301 HTTP 状态代码,并包含用于将请求重定向到的 URL。The RedirectPermanent(String, Boolean) method overload provides a 301 HTTP status code in the response and includes the URL to redirect the request to. 此方法重载还提供了用于指定是否在执行重定向后终止或完成响应的选项。This method overload also provides the option to specify whether to terminate or to complete the response after the redirection has been performed. 301 HTTP 状态代码是 HTTP 响应中的标准代码。A 301 HTTP status code is a standard code in an HTTP response. 它指示存在永久重定向,并且它提供重定向位置。It indicates that a permanent redirection exists, and it provides the redirection location.

RedirectPermanent(String) RedirectPermanent(String) RedirectPermanent(String) RedirectPermanent(String)

执行从所请求 URL 到所指定 URL 的永久重定向。Performs a permanent redirection from the requested URL to the specified URL.

public:
 void RedirectPermanent(System::String ^ url);
public void RedirectPermanent (string url);
member this.RedirectPermanent : string -> unit
Public Sub RedirectPermanent (url As String)

参数

url
String String String String

要将请求重定向至的位置。The location to redirect the request to.

异常

url 包括一个换行符 (\n)。url includes a newline character (\n).

注解

RedirectPermanent(String)方法重载在响应中提供 301 HTTP 状态代码,并包含用于将请求重定向到的 URL。The RedirectPermanent(String) method overload provides a 301 HTTP status code in the response and includes the URL to redirect the request to. 301 HTTP 状态代码是 HTTP 响应中的标准代码。A 301 HTTP status code is a standard code in an HTTP response. 它指示存在永久重定向,并且它提供重定向位置。It indicates that a permanent redirection exists, and it provides the redirection location.

RedirectPermanent(String)调用方法重载会终止响应。Calling the RedirectPermanent(String) method overload terminates the response.

适用于