Interface CfnBucket.IRedirectRuleProperty
Specifies how requests are redirected.
Namespace: Amazon.CDK.AWS.S3
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IRedirectRuleProperty
Syntax (vb)
Public Interface 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.AWS.S3;
var redirectRuleProperty = new RedirectRuleProperty {
HostName = "hostName",
HttpRedirectCode = "httpRedirectCode",
Protocol = "protocol",
ReplaceKeyPrefixWith = "replaceKeyPrefixWith",
ReplaceKeyWith = "replaceKeyWith"
};
Synopsis
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. |
Properties
HostName
The host name to use in the redirect request.
virtual string HostName { get; }
Property Value
System.String
Remarks
HttpRedirectCode
The HTTP redirect code to use on the response.
virtual string HttpRedirectCode { get; }
Property Value
System.String
Remarks
Not required if one of the siblings is present.
Protocol
Protocol to use when redirecting requests.
virtual string Protocol { get; }
Property Value
System.String
Remarks
The default is the protocol that is used in the original request.
ReplaceKeyPrefixWith
The object key prefix to use in the redirect request.
virtual string ReplaceKeyPrefixWith { get; }
Property Value
System.String
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 XML related object key constraints .
ReplaceKeyWith
The specific object key to use in the redirect request.
virtual string ReplaceKeyWith { get; }
Property Value
System.String
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 XML related object key constraints .