How do I redirect a domain in CloudFront?
I want to redirect my domain to another domain in Amazon CloudFront. How can I do this?
"I want to redirect my domain to another domain in Amazon CloudFront. How can I do this?Short descriptionTo redirect a domain in CloudFront, use one of the following:An Amazon Simple Storage Service (Amazon S3) website endpoint that returns a 301 status codeAn edge function that redirects requests to the new domainAn Amazon S3 website endpoint redirection moves the existing URL path to the redirected domain. Edge functions allow you to redirect viewers to other pages based on information in the request, or rewrite all requests from one path to another.ResolutionUse an Amazon S3 endpoint that returns a 301 status codeFollow the instructions in theRedirect using Route 53 and Amazon S3 section of How can I redirect one domain to another in Route 53?Use an edge function that redirects requests to the new domainFor more information on the difference between Lambda@Edge and CloudFront functions, see Choosing between CloudFront Functions and Lambda@Edge.For Lambda@Edge:See Customizing at the edge with Lambda@Edge. For example code, see Example: Generating an HTTP redirect (generated response).For CloudFront Functions:See Customizing at the edge with CloudFront Functions. For example code, see Redirect the viewer to a new URL.Related informationConfiguring a webpage redirectCreating a Lambda@Edge function in the Lambda consoleTutorial: Creating a simple function with CloudFront FunctionsFollow"