Hi all,
I have a single-page AJAX application that is currently is served from S3 with CloudFront in front of it (providing SSL via ACM). Now, I want to redirect some crawlers accessing the site to pretender.io or similar to get the nice SEO goodness as well as the proper Facebook and Twitter sharing meta tags. Given that those crawlers don’t speak JS, how can I redirect based on HTTP User-Agent header within the AWS infrastructure?
-
Obviously I could run Apache or Nginx on a small EC2 instance serving the JS files and doing a redirect, but the whole reason for hosting them on S3/Cloudfront was to stay serverless and not have to worry about multiple servers, patching, etc.
-
As far as I know It is not possible to rewrite requests based on user-agent in S3, the way you can rewrite keys
-
CloundFront won’t route based on User-Agent from what I know
-
An ELB won’t route based on HTTP headers
-
I through of using a WAF since that can parse HTTP headers, but that will only ALLOW or BLOCK a request, not rewrite/redirect it
Any thoughts on an AWS-native way to do this?
Related discussions: