Last active
June 4, 2017 11:05
-
-
Save 4lun/b1926ea9ad435b29ec9006908cf2318f to your computer and use it in GitHub Desktop.
Redirect all requests from an S3 bucket to another domain with explicit path (example redirects all requests to newdomain.com/?referrer=olddomain). Substitute 404 code with 403 if bucket is not publicly readable. Note this all assumes there are no matching files in the bucket.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<RoutingRules> | |
<RoutingRule> | |
<Condition> | |
<HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals> | |
</Condition> | |
<Redirect> | |
<HostName>newdomain.com</HostName> | |
<ReplaceKeyWith>?referrer=olddomain</ReplaceKeyWith> | |
</Redirect> | |
</RoutingRule> | |
</RoutingRules> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment