HttpResponse.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 redirection from a requested URL to a specified URL.
Overloads
RedirectPermanent(String, Boolean) |
Performs a permanent redirection from the requested URL to the specified URL, and provides the option to complete the response. |
RedirectPermanent(String) |
Performs a permanent redirection from the requested URL to the specified URL. |
RedirectPermanent(String, Boolean)
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)
Parameters
- url
- String
The location 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 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. 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.
Applies to
RedirectPermanent(String)
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)
Parameters
- url
- String
The location 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 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 redirection exists, and it provides the redirection location.
Calling the RedirectPermanent(String) method overload terminates the response.
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈