Skip to content

Instantly share code, notes, and snippets.

@mikeschinkel
Last active December 11, 2015 03:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeschinkel/4540606 to your computer and use it in GitHub Desktop.
Save mikeschinkel/4540606 to your computer and use it in GitHub Desktop.
These are the redirect rules I'm trying and I can't get Amazon S3 to redirect. The file error-response.xml shows the response I'm getting from attempting to access https://s3.amazonaws.com/mks-test/images/foo.png.
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Key>images/foo.png</Key>
<RequestId>0DEAA52044F15478</RequestId>
<HostId>sP9OB63Dr0bIbfJXR2HyeHUt5TN7otiG3V3MFUv5qxySfaX9uKVV8MsxyQ6jeBMB</HostId>
</Error>
Docs on Redirect Configuration:
- http://docs.aws.amazon.com/AmazonS3/latest/dev/HowDoIWebsiteConfiguration.html
URL I'm trying to get to redirect:
- https://s3.amazonaws.com/mks-test/images/foo.png
<RoutingRules>
<RoutingRule>
<Condition>
<HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals>
</Condition>
<Redirect>
<HostName>hardcorewp.com</HostName>
<HttpRedirectCode>302</HttpRedirectCode>
</Redirect>
</RoutingRule>
</RoutingRules>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment