語言

HttpResponse.RedirectPermanent 方法

定義

執行從請求的 URL 永久導向到指定的 URL。

多載

名稱 Description
RedirectPermanent(String, Boolean)

執行從請求的 URL 永久導向到指定的 URL,並提供完成回應的選項。

RedirectPermanent(String)

執行從請求的 URL 永久重定向到指定的 URL。

RedirectPermanent(String, Boolean)

執行從請求的 URL 永久導向到指定的 URL,並提供完成回應的選項。

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

重新導向請求的地點。

endResponse
Boolean

true 終止回應;否則 false。 預設值為 false。

例外狀況

url 是 null。

url 包含一個換行字元(\n)。

備註

方法過載會在 RedirectPermanent(String, Boolean) 回應中提供 301 HTTP 狀態碼,並包含用來重新導向請求的 URL。 此方法過載也提供選擇,指定在重定向完成後是終止回應或完成回應。 301 HTTP 狀態碼是 HTTP 回應中的標準碼。 它表示存在永久的重定向,並提供重定向的位置。

適用於

RedirectPermanent(String)

執行從請求的 URL 永久重定向到指定的 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

重新導向請求的地點。

例外狀況

url 是 null。

url 包含一個換行字元(\n)。

備註

方法過載會在 RedirectPermanent(String) 回應中提供 301 HTTP 狀態碼,並包含用來重新導向請求的 URL。 301 HTTP 狀態碼是 HTTP 回應中的標準碼。 它表示存在永久的重定向,並提供重定向的位置。

呼叫 RedirectPermanent(String) 方法過載會終止回應。

適用於