HttpResponseBase.RedirectPermanent 方法

定義

執行從要求之 URL 至指定之 URL 的永久重新導向。

多載

RedirectPermanent(String, Boolean)

永遠從要求的 URL 重新導向至指定的 URL,並提供完成回應的選項。

RedirectPermanent(String)

永遠從要求的 URL 重新導向至指定的 URL。

RedirectPermanent(String, Boolean)

永遠從要求的 URL 重新導向至指定的 URL,並提供完成回應的選項。

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

參數

url
String

重新導向要求的位置。

endResponse
Boolean

true 表示終止回應,否則為 false。 預設為 false

例外狀況

備註

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

適用於

RedirectPermanent(String)

永遠從要求的 URL 重新導向至指定的 URL。

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

參數

url
String

重新導向要求的位置。

例外狀況

備註

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

呼叫 方法會 RedirectPermanent(String) 終止回應的其餘部分。

適用於