I try to get the S3 bucket when it encounters 404, and does not throw the 404 page, redirects it to my own server, so I can do something with an error.
This is what I put together, I think it needs to be done, go to mydomain.com and click on the error.php file and run the php script workout the name of the file that the user was trying to access on S3.
I would like this to happen no matter in which folder the request is requested. When I have an error document defined on a web hosting page 404 appears, and when I do not have a specific page on 404, I get an access denied error.
This is my current redirection rule.
<RoutingRules> <RoutingRule> <Condition> <HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals> </Condition> <Redirect> <HostName>www.mydomain.com</HostName> <ReplaceKeyPrefixWith>error.php#!/</ReplaceKeyPrefixWith> </Redirect> </RoutingRule> </RoutingRules>
Can someone give me a hint about what I will miss, please?
source share