HttpResponseWrapper.RedirectPermanent Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Performs a permanent redirect from a requested URL to the specified URL.
Overloads
RedirectPermanent(String, Boolean) |
Performs a permanent redirect from the requested URL to the specified URL, and provides the option to complete the response. |
RedirectPermanent(String) |
Performs a permanent redirect from the requested URL to the specified URL. |
RedirectPermanent(String, Boolean)
Performs a permanent redirect from the requested URL to the specified URL, and provides the option to complete the response.
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)
Parameters
- url
- String
The URL to redirect the request to.
- endResponse
- Boolean
true
to terminate the response; otherwise false
. The default is false
.
Exceptions
url
is null
.
url
includes a newline character (\n
).
Remarks
The RedirectPermanent(String, Boolean) method overload provides a 301 HTTP status code in the response and also includes the URL to redirect the request to. This method overload provides the option to specify whether to terminate the response or to complete it after the redirect has been performed. A 301 HTTP status code is a standard code in an HTTP response. It indicates that a permanent redirect exists, and it provides the redirect location.
Applies to
RedirectPermanent(String)
Performs a permanent redirect from the requested URL to the specified 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)
Parameters
- url
- String
The URL to redirect the request to.
Exceptions
url
is null
.
url
includes a newline character (\n
).
Remarks
The RedirectPermanent(String) method overload provides a 301 HTTP status code in the response and also includes the URL to redirect the request to. A 301 HTTP status code is a standard code in an HTTP response. It indicates that a permanent redirect exists, and it provides the redirect location.
Calling the RedirectPermanent(String) method terminates the rest of the response.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기