> **Experimental**
>
> `@aws-cdk/aws-amplify-alpha` is an [**experimental**](https://docs.aws.amazon.com/cdk/api/stability.html) (alpha) package: its API may change in any release, without a major version bump.
# RedirectStatus

The status code for a URL rewrite or redirect rule.

- Stability: [Experimental](https://docs.aws.amazon.com/cdk/api/stability.html)
- Source: [`lib/app.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/@aws-cdk/aws-amplify-alpha/lib/app.ts#L464)

## Example

TypeScript:

```ts
import { CustomRule } from '@aws-cdk/aws-amplify-alpha';

declare const amplifyApp: amplify.App;
amplifyApp.addCustomRule(new CustomRule({
  source: '/docs/specific-filename.html',
  target: '/documents/different-filename.html',
  status: amplify.RedirectStatus.TEMPORARY_REDIRECT,
}));
```

Python:

```python
from aws_cdk.aws_amplify_alpha import CustomRule

# amplify_app: amplify.App

amplify_app.add_custom_rule(CustomRule(
    source="/docs/specific-filename.html",
    target="/documents/different-filename.html",
    status=amplify.RedirectStatus.TEMPORARY_REDIRECT
))
```

Java:

```java
import software.amazon.awscdk.services.amplify.alpha.CustomRule;

App amplifyApp;

amplifyApp.addCustomRule(CustomRule.Builder.create()
        .source("/docs/specific-filename.html")
        .target("/documents/different-filename.html")
        .status(RedirectStatus.TEMPORARY_REDIRECT)
        .build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.Amplify.Alpha
using Amazon.CDK.AWS.Amplify.Alpha;

App amplifyApp;

amplifyApp.AddCustomRule(new CustomRule(new CustomRuleOptions {
    Source = "/docs/specific-filename.html",
    Target = "/documents/different-filename.html",
    Status = RedirectStatus.TEMPORARY_REDIRECT
}));
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdkamplifyalpha/v2
import "github.com/aws/aws-cdk-go/awscdkamplifyalpha"

var amplifyApp App

amplifyApp.AddCustomRule(awscdkamplifyalpha.NewCustomRule(&CustomRuleOptions{
	Source: jsii.String("/docs/specific-filename.html"),
	Target: jsii.String("/documents/different-filename.html"),
	Status: amplify.RedirectStatus_TEMPORARY_REDIRECT,
}))
```

## Members

| Member | Description |
| --- | --- |
| `REWRITE` | Rewrite (200). |
| `PERMANENT_REDIRECT` | Permanent redirect (301). |
| `TEMPORARY_REDIRECT` | Temporary redirect (302). |
| `NOT_FOUND` | Not found (404). |
| `NOT_FOUND_REWRITE` | Not found rewrite (404). |

## Referenced by

- [`CustomRule`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-amplify-alpha.CustomRule.html).status
- [`CustomRuleOptions`](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-amplify-alpha.CustomRuleOptions.html).status
