We recently moved our website to Amazon S3 (all static pages). We moved al static files to a different subdomain which still points to our old server.
All is working
The key is to use ReplaceKeyPrefixWith instead of ReplaceKeyWith.
With Gulp and gulp-awspublish for instance, the config is in JSON.
So going from:
Condition:
KeyPrefixEquals: 'us.html'
Redirect:
ReplaceKeyWith: 'about.html'
To
Condition:
KeyPrefixEquals: 'us.html'
Redirect:
ReplaceKeyPrefixWith: 'about.html'
Will make example.com/us.html?a=1 redirect to example.com/about.htmk?a=1.
Be careful of loops, eg.
Condition:
KeyPrefixEquals: 'about'
Redirect:
ReplaceKeyPrefixWith: 'about.html'
Will make a redirect loop by adding .html.html.html etc.