HttpResponseBase.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 the requested URL to a 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:
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)
Parameters
- url
- String
The location to which the request is redirected.
- endResponse
- Boolean
true
to terminate the response; otherwise false
. The default is false
.
Exceptions
Always.
Remarks
The RedirectPermanent(String, Boolean) overload method provides a 301 HTTP status code in the response and includes the URL to redirect the request to. This overload also provides the option to specify whether to terminate or to complete the response 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:
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)
Parameters
- url
- String
The location to which the request is redirected.
Exceptions
Always.
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 redirect exists, and it provides the redirect location.
Calling the RedirectPermanent(String) method terminates the rest of the response.