# Network Services V1 API - Class Google::Cloud::NetworkServices::V1::HttpRoute::Redirect (v2.10.1)

2.10.1 (latest) 2.10.0 2.9.0 2.8.0 2.7.0 2.6.1 2.5.0 2.4.0 2.3.0 2.2.0 2.1.0 2.0.1 1.2.0 1.1.0 1.0.1 0.2.0 0.1.0 Reference documentation and code samples for the Network Services V1 API class Google::Cloud::NetworkServices::V1::HttpRoute::Redirect.

The specification for redirecting traffic.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #host_redirect

    def host_redirect() -> ::String

**Returns**

- (::String) --- The host that will be used in the redirect response instead of the one that was supplied in the request.

### #host_redirect=

    def host_redirect=(value) -> ::String

**Parameter**

- **value** (::String) --- The host that will be used in the redirect response instead of the one that was supplied in the request.
**Returns**

- (::String) --- The host that will be used in the redirect response instead of the one that was supplied in the request.

### #https_redirect

    def https_redirect() -> ::Boolean

**Returns**

- (::Boolean) --- If set to true, the URL scheme in the redirected request is set to https. If set to false, the URL scheme of the redirected request will remain the same as that of the request.

  The default is set to false.

### #https_redirect=

    def https_redirect=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- If set to true, the URL scheme in the redirected request is set to https. If set to false, the URL scheme of the redirected request will remain the same as that of the request.


  The default is set to false.
**Returns**

- (::Boolean) --- If set to true, the URL scheme in the redirected request is set to https. If set to false, the URL scheme of the redirected request will remain the same as that of the request.

  The default is set to false.

### #path_redirect

    def path_redirect() -> ::String

**Returns**

- (::String) --- The path that will be used in the redirect response instead of the one that was supplied in the request. path_redirect can not be supplied together with prefix_redirect. Supply one alone or neither. If neither is supplied, the path of the original request will be used for the redirect.

### #path_redirect=

    def path_redirect=(value) -> ::String

**Parameter**

- **value** (::String) --- The path that will be used in the redirect response instead of the one that was supplied in the request. path_redirect can not be supplied together with prefix_redirect. Supply one alone or neither. If neither is supplied, the path of the original request will be used for the redirect.
**Returns**

- (::String) --- The path that will be used in the redirect response instead of the one that was supplied in the request. path_redirect can not be supplied together with prefix_redirect. Supply one alone or neither. If neither is supplied, the path of the original request will be used for the redirect.

### #port_redirect

    def port_redirect() -> ::Integer

**Returns**

- (::Integer) --- The port that will be used in the redirected request instead of the one that was supplied in the request.

### #port_redirect=

    def port_redirect=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- The port that will be used in the redirected request instead of the one that was supplied in the request.
**Returns**

- (::Integer) --- The port that will be used in the redirected request instead of the one that was supplied in the request.

### #prefix_rewrite

    def prefix_rewrite() -> ::String

**Returns**

- (::String) --- Indicates that during redirection, the matched prefix (or path) should be swapped with this value. This option allows URLs be dynamically created based on the request.

### #prefix_rewrite=

    def prefix_rewrite=(value) -> ::String

**Parameter**

- **value** (::String) --- Indicates that during redirection, the matched prefix (or path) should be swapped with this value. This option allows URLs be dynamically created based on the request.
**Returns**

- (::String) --- Indicates that during redirection, the matched prefix (or path) should be swapped with this value. This option allows URLs be dynamically created based on the request.

### #response_code

    def response_code() -> ::Google::Cloud::NetworkServices::V1::HttpRoute::Redirect::ResponseCode

**Returns**

- ([::Google::Cloud::NetworkServices::V1::HttpRoute::Redirect::ResponseCode](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/Google-Cloud-NetworkServices-V1-HttpRoute-Redirect-ResponseCode)) --- The HTTP Status code to use for the redirect.

### #response_code=

    def response_code=(value) -> ::Google::Cloud::NetworkServices::V1::HttpRoute::Redirect::ResponseCode

**Parameter**

- **value** ([::Google::Cloud::NetworkServices::V1::HttpRoute::Redirect::ResponseCode](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/Google-Cloud-NetworkServices-V1-HttpRoute-Redirect-ResponseCode)) --- The HTTP Status code to use for the redirect.
**Returns**

- ([::Google::Cloud::NetworkServices::V1::HttpRoute::Redirect::ResponseCode](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/Google-Cloud-NetworkServices-V1-HttpRoute-Redirect-ResponseCode)) --- The HTTP Status code to use for the redirect.

### #strip_query

    def strip_query() -> ::Boolean

**Returns**

- (::Boolean) --- if set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained.

  The default is set to false.

### #strip_query=

    def strip_query=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- if set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained.


  The default is set to false.
**Returns**

- (::Boolean) --- if set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained.

  The default is set to false.