I cannot send www.example.com to example.com in aws route53 - amazon-web-services

I'm using route53, elb, ec2 in aws.
I have set example.com connected to elb.
It works fine.
Currenlty, I'm trying to connect www.example.com to example.com,
and I'm stuck.
I checked whether I can connect test.example.com to example.com,
and It worked. Either using CNAME or using s3 static website hosting
(redirection) worked.
But for www.example.com, these methods doesn't work,
and I'm not figuring out why.
Thank you for answering my question.
I'm updating the details.
I have set my domain example.com on Route53, and I can access to it. I also wanted it to be accessible with www.example.com, so I added a CNAME record www.example.com pointing to example.com. However, my browser failed to load www.example.com.
I tried another method, S3 static website hosting. I created a bucket named www.example.com, made it redirect to example.com, and got a s3 url. I added a CNAME record www.example.com pointing to the s3 url. Again, my browser failed to load www.example.com.
I changed my approach.
Instead of www, I decided to test test.example.com with the same methods that I tried, and it worked fine. My browser loaded test.example.com successfully.
When I tried to access test.example.com, it fails to load fast when it's not configured. On the other hand, with www.example.com, the browser displays loading message on the status bar for a long time, and shows white blank screen.
I want to make it work with www.example.com

You haven't said exactly what you've done to redirect between mydomain.com and www.mydomain.com so it's difficult to tell you why it isn't working.
I have my personal domain set up in this way, where the bucket mydomain.com is set up in S3 to "Redirect all requests to another host name" and that host name is www.mydomain.com (see the "static website hosting" section in the bucket properties).
I notice that in Route 53 I have A records set up for both mydomain.com and www.mydomain.com and in both cases I have aliases set up aliasing the target s3-website-eu-west-1.amazonaws.com. to a hosted zone ID. I don't remember doing that though!

Related

How to redirect www.example.com to example.com in route53 aws?

I have setup record in route53 for example.com to point to my cloudfront distribution(serves all the static files). I want browser to redirect to example.com if user goes to www.example.com. I could point www to same cloudfront distribution, but then browser treats both these domains as seperate sites. They use different local browser cache and all. I want them to use same local cache.
I found the answer myself after lot of research. Point www to a s3 endpoint configured to redirect to example.com. Refer this article for more info.
Also, I am now using google domains instead of route 53 because it has inbuilt option to redirect subdomain.

Redirect to WWW not working in chrome with S3 static website hosting

I have hosted a static website on AWS S3 with a custom domain (purchased from crazy domain). I have obtained SSL certificate from AWS ACM.
I need to redirect bare domain "example.com" to "https://www.example.com".
Following are the steps I have followed so far -
Created 2 buckets on S3 - example.com (Used for redirection) and www.example.com (Used for website hosting)
Created 2 cloudfront distribution -
One with "Origin Domain Name" as "example.com.s3.amazonaws.com" and another with another with "Origin Domain Name" as "www.example.com.s3-website-ap-southeast-2.amazonaws.c
om"
Created CNAME record set on crazy domain with WWW pointing to cloudfront distribution as
Added "A" record set in Route53 for both cloudfront distributions.
When I enter example.com in Firefox and Safari, it is redirecting to https://www.example.com but in Chrome it is showing This site can’t be reached
Can anyone please let me know if there is anything specific I need to do for Chrome?
Finally I have figure it out as -
Added NS record set from Route53 to Crazy domain
Removed CNAME record set with www
Added Web Forward record set in crazy domain

Redirecting from example.com to www.example.com with AWS Cloudfront and S3

I currently have my website running at https://www.example.com. I did this by creating an S3 bucket hosting the site called www.example.com, then I created a Cloudfront instance to add SSL.
I then created a CNAME in Godaddy which points to the Cloudfront URL.
If I visit http://example.com, GoDaddy correctly redirects to http://www.example.com, which Cloudfront correctly redirects to https://www.example.com.
HOWEVER, if I visit https://example.com, I get a blank page. How can I make the SSL naked domain redirect to www?
Proved myself wrong in rereading your question:
“Unfortunately, our forwarding servers don't accept HTTPS requests. This is why your forward isn't working. Traffic coming into the forwarding server using the HTTPS protocol won't resolve. The only way you'd be able to set this up is to have the domain hosted on a server where it has an SSL Certificate installed. You could then set up a redirect to point traffic from your old domain to your new one. “
https://www.godaddy.com/community/SSL-And-Security/Forwarding-works-as-long-as-URL-does-not-contain-https/td-p/44951
You should probably just move the domain to route53.

Redirect naked domain to WWW in Route 53

I have seen a few questions about this but the answer is not working for me. I want to redirect the naked domain to www. I have my site deployed in a S3 bucket and a Cloudfront distribution.
This questions are similar:
https://serverfault.com/questions/576461/redirect-non-www-requests-to-www-on-amazon-route-53
How do I redirect a naked (apex) domain to www using Route 53?
This is what I have:
A static website in a S3 bucket: www.mysitename.com
Another website (empty) in a S3 bucket: mysitename.com configured to be redirecting everything to www.mysitename.com
A cloudfront distribution over the bucket www.mysitename.com
Route 53
Everything works well in the www.mysitename.com domain, but the naked domain is not working.
The ways it's configured in Route 53 is the following:
A Record, www.mysitename.com with Alias to my Cloudfront distribution (works perfect).
A Record, mysitename.com with Alias to my S3 bucket.
If I go to my "mysitename.com.s3-...." S3 bucket it redirects correctly to the other bucket. But If I go to the naked domain, it doesn't work.
The error I get is:
This site can’t be reached xxxxxxxx.com took too long to respond.
Try: Checking the connection Checking the proxy and the firewall Running Network Diagnostics ERR_CONNECTION_TIMED_OUT
It resolves to a Amazon S3 IP correctly. If I go to the IP it opens https://aws.amazon.com/s3/.
What am I missing?
https://forums.aws.amazon.com/thread.jspa?threadID=55995
Shortcut:
Just point your naked/root domain to 174.129.25.170 and all requests to example.com will be redirected to www.example.com
No signup needed, uptime is published on a website.
It is an EC2 instance doing only redirects.
Full disclosure: User "Dima" made this service.

Amazon AWS static page showing URL as Endpoint

I have a domain address with NameCheap. I followed all of the documentation for setting up a hosted zone with Route 53 for my AWS account. I deployed my website and checked to see if it worked using the endpoint URL. It worked fine. After that, I took the 4 NS urls from the Hosted Zone and mapped them in NameCheap following a tutorial I found online. I chose a Custom DNS for the Name Server and placed the 4 NS urls.
This all worked fine, when I go to my domain: www.example.com it shows my website. However it changes the URL to http://example.com.s3-website-us-east-1.amazonaws.com/
Is there a way to get it to say www.example.com and not the Amazon endpoint?
It appears that this only happens when I go to www.example.com. When I go to example.com, the url stays as example.com and doesn't change to the end point like it does for www.example.com.
Is there a step I missed?
I have 2 buckets: example.com and www.example.com. www.example.com bucket redirects to example.com as described in the AWS tutorial.
http://docs.aws.amazon.com/gettingstarted/latest/swh/getting-started-hosting-your-website.html
You need to create another s3 bucket named www.example.com, and configure it to redirect to example.com.