I have a bucket on S3 that is configured to be a static website. I'd like to have any requests to the root domain automatically redirect to a subfolder, for instance example.com => example.com/campaign
.
This can be accomplished by applying the Website-Redirect-Location
metadata to the root index.html
object. However when I apply this all other metadata values I add appear to be getting ignored. Is this the intended behavior? Can I not apply other metadata if I'm doing a redirect?
In my particular use-case, I'd like to be able to apply Cache-Control
and Expires
headers on my index.html
object so I can change the redirect value (for instance, change the redirect to example.com => example.com/new-campaign
) and have browsers invalidate their cache. Is there any way to accomplish this with S3?