HttpResponseWrapper.RedirectPermanent 方法

定義

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

多載

RedirectPermanent(String, Boolean)

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

RedirectPermanent(String)

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

RedirectPermanent(String, Boolean)

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

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

參數

url
String

要求將重新導向至其中的 URL。

endResponse
Boolean

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

例外狀況

urlnull

url 包含新行字元 (\n)。

備註

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

適用於

RedirectPermanent(String)

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

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

參數

url
String

要求將重新導向至其中的 URL。

例外狀況

urlnull

url 包含新行字元 (\n)。

備註

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

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

適用於