Redirect working from www.xyz.com to https://xyz.com but not from https://www.xyz.com

+1 vote

I've hosted a static website on AWS using S3, CloudFront and Route53.

I issued a certificate (covering *.xyz.com and xyz.com) with Certificate Manager and everything is working fine when I enter xyz.com and www.xyz.com. Both URLs redirect to https://xyz.com, which is exactly what I want.

But if i try to go to https://www.xyz.com it does not work, although http://www.xyz.com does work. Why is that?

I'm assuming I'm doing something wrong in Route53 or CloudFront.

Aug 28, 2018 in AWS by bug_seeker
• 15,350 points
86 views

1 answer to this question.

0 votes
  1. Make sure you have created the certificate in us-east-1 region to be used with Cloudfront.

  2. Make sure you have entered both www.example.com and example.com in CloudFront Alternate CNAME entries.

  3. Make sure the behavior is set to Redirect HTTP to HTTPS

  4. Make sure index.html file is present in the origin. It can also be specified explicitly in Cloudfront distribution.

If you can provide your distribution settings, it would be helpful.

answered Aug 28, 2018 by Priyaj
• 56,520 points

Related Questions In AWS

0 votes
1 answer

Redirect HTTP traffic to HTTPS request on ELB

Change your server config file if ($http_x_forwarded_proto = ...READ MORE

answered May 16 in AWS by Vedant
26 views
+1 vote
2 answers
+1 vote
10 answers
+2 votes
3 answers
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
147 views
+1 vote
2 answers

AWS CloudWatch Logs in Docker

The awslogs works without using ECS. you need to configure ...READ MORE

answered Sep 6, 2018 in AWS by bug_seeker
• 15,350 points
329 views
+1 vote
3 answers

Not able to pass params POST to AWS Lambda from Amazon API Gateway

For this template : application/x-www-form-urlencoded  This line below will ...READ MORE

answered Jun 13, 2018 in AWS by Cloud gunner
• 4,260 points
2,006 views
0 votes
1 answer