Class CfnBucketPropsMixin.RedirectRuleProperty
Specifies how requests are redirected.
Implements
Inherited Members
Namespace: Amazon.CDK.Mixins.Preview.AWS.S3.Mixins
Assembly: Amazon.CDK.Mixins.Preview.dll
Syntax (csharp)
public class CfnBucketPropsMixin.RedirectRuleProperty : CfnBucketPropsMixin.IRedirectRuleProperty
Syntax (vb)
Public Class CfnBucketPropsMixin.RedirectRuleProperty Implements CfnBucketPropsMixin.IRedirectRuleProperty
Remarks
In the event of an error, you can specify a different error code to return.
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.Mixins.Preview.AWS.S3.Mixins;
var redirectRuleProperty = new RedirectRuleProperty {
HostName = "hostName",
HttpRedirectCode = "httpRedirectCode",
Protocol = "protocol",
ReplaceKeyPrefixWith = "replaceKeyPrefixWith",
ReplaceKeyWith = "replaceKeyWith"
};
Synopsis
Constructors
| RedirectRuleProperty() | Specifies how requests are redirected. |
Properties
| HostName | The host name to use in the redirect request. |
| HttpRedirectCode | The HTTP redirect code to use on the response. |
| Protocol | Protocol to use when redirecting requests. |
| ReplaceKeyPrefixWith | The object key prefix to use in the redirect request. |
| ReplaceKeyWith | The specific object key to use in the redirect request. |
Constructors
RedirectRuleProperty()
Specifies how requests are redirected.
public RedirectRuleProperty()
Remarks
In the event of an error, you can specify a different error code to return.
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.Mixins.Preview.AWS.S3.Mixins;
var redirectRuleProperty = new RedirectRuleProperty {
HostName = "hostName",
HttpRedirectCode = "httpRedirectCode",
Protocol = "protocol",
ReplaceKeyPrefixWith = "replaceKeyPrefixWith",
ReplaceKeyWith = "replaceKeyWith"
};
Properties
HostName
The host name to use in the redirect request.
public string? HostName { get; set; }
Property Value
Remarks
HttpRedirectCode
The HTTP redirect code to use on the response.
public string? HttpRedirectCode { get; set; }
Property Value
Remarks
Not required if one of the siblings is present.
Protocol
Protocol to use when redirecting requests.
public string? Protocol { get; set; }
Property Value
Remarks
The default is the protocol that is used in the original request.
ReplaceKeyPrefixWith
The object key prefix to use in the redirect request.
public string? ReplaceKeyPrefixWith { get; set; }
Property Value
Remarks
For example, to redirect requests for all pages with prefix docs/ (objects in the docs/ folder) to documents/ , you can set a condition block with KeyPrefixEquals set to docs/ and in the Redirect set ReplaceKeyPrefixWith to /documents . Not required if one of the siblings is present. Can be present only if ReplaceKeyWith is not provided.
Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints">XML related object key constraints</a> .
ReplaceKeyWith
The specific object key to use in the redirect request.
public string? ReplaceKeyWith { get; set; }
Property Value
Remarks
For example, redirect request to error.html . Not required if one of the siblings is present. Can be present only if ReplaceKeyPrefixWith is not provided.
Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints">XML related object key constraints</a> .