subdomain www is showing bucket webserver address instead the domain name - amazon-web-services

I created the following routes in Route53:
something.ie A s3-website-eu-west-1.amazonaws.com.
something.ie NS ns-XXX.awsdns-XX.com. (more NSs)
something.ie SOA ns-XXX.awsdns-XX.com. awsdns-hostmaster.amazon.com. (more info)
www.something.ie A s3-website-eu-west-1.amazonaws.com.
When I access: something.ie it shows the proper endpoint.
However, when I access www.something.ie or http://something.ie it shows:
http://something.ie.s3-website-eu-west-1.amazonaws.com/
and I'm expecting to see only something.ie not the se-website...
The S3 buckets are set as following:
something.ie Public
www.something.ie Objects can be public
Both are Static website hosting. The www.something.ie has Hosting type: Redirect request redirecting the requests to bucket something.ie.
What is wrong?

Related

SPA on AWS S3 bucket using CloudFront with non WWW

I’m deploying a SPA in a S3 bucket. I’m using cloudfront to work through https. I need to redirect or delete the www in my domain (example.com). I tried this process:
create a s3 bucket to the www domain (www.example.com) and redirect all requests to the default domain (example.com)
create a distribution for www domain (www.example.com)
create an A type record in Route53 that points to the www distribution
The result is that it’s not redirecting to the non-www bucket. What is happening is that its waiting to find index.html (configured in the default root object) of the www bucket and is thus not redirecting to the other bucket (the non www one)
This is my S3 configuration:
And Cloudfront configuration:
Based on OP's feedback in the comment section, changing the CloudFront origin to use the website endpoint works.

Configure domain on Godaddy to Amazon S3 bucket

I have the static website hosted on S3 which is displaying correctly using the Amazon s3 link.
As per Amazon docs, I created two buckets, example.io & www.example.io. The example.io has the content (files) for the website; the www.example.io bucket is redirecting to the phlo.io bucket.
I am trying to configure Godaddy Apex domain DNS settings to redirect to the S3 bucket. As an example, the domain is http://example.io & I entered the settings in Godaddy domain DNS in the following form:
Type: CNAME
Name: www
value: example.io.s3-website.eu-west-2.amazonaws.com
TTL: 1 hour
However, the website is not displaying on the link http://example.io. How do I configure the apex domain to display the static website?
You can't, sorry...
AWS do not provide an IP Address that you can add as the Apex A Record. This causes issues using S3, CloudFront, ELB, and API Gateway.
If you are using AWS Route53, you can set the Apex A Record as an "alias" to those other services in your AWS account. This is an AWS bespoke service to get around only being able to set an A Record IP Address as the Apex Address.
So you can either move your DNS to AWS, or use a www redirection service. This will provide you with an IP Address which will respond with a redirection to your www.example.io address. People often use services like wwwizer.com to do this for free: http://wwwizer.com/naked-domain-redirect
On further investigation, it turns out that GoDaddy offers http redirection in its DNS service. Here is a guide to setting up naked domain name redirection to the www sub domain: https://help.ghost.org/article/17-custom-domains-using-godaddy
Steps to follow to redirect all traffic from www.yourdomain.com to www.yours3bucket.amazonaws.com
Create a bucket with the same name as your domain name(in this case www.yourdomain.com), make it public and host it.
Go to Godaddy DNS Server and Enter a CNAME Entry with host as www, Points to as www.yours3bucket.amazonaws.com and TTL as default.
(This is to redirect all the traffic to your AWS S3 Bucket, It will only work with www.yourdomain.com and not with yourdomain.com if you do not set a forwarding as mentioned on step 3)
Now also add a 301 forwarding to http://www.yourdomain.com or https://www.yourdomain.com.
(This is to forward yourdomain.com to www.yourdomain.com)

Domain redirection based on Geo - AWS

I have basically 2 hosted zones **.com and **.co.in. For all the incoming traffic from India , if user browses .com it should automatically redirect to co.in . How do we do this in AWS . I read this http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-values-geo.html#rrsets-values-geo-location and implemented in co.in hosted zone but does not seem to work. Also I think there should be some domain redirection set up in .com but cant find where we can do in Route53
Regards
Raghav
To simplify my solution, I'm going to refer to these domains as example.com and example.co.in. Here's how I'd solve this:
S3 Bucket for example.com:
Static Website Hosting:
Redirect Requests:
Target Bucket or Domain: example.co.in
Note the region that this bucket is created in, such as us-east-1, we'll need that later
Route 53 Record Set for example.com For India:
Type: CNAME
Value: example.co.in.s3-static-website-[region].amazonaws.com
Routing Policy: Geolocation
Location: India
Set ID: India Redirect
Route 53 Record Set for example.com Not India:
You'd set your Type and Value as normal
Routing Policy: Geolocation
Location: Default
Set ID: Regular Traffic
Further Reading:
Geolocation Resource Record Sets
How Do I Redirect Requests to an S3 Bucket Hosted Website to Another Host?

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.

For S3 site, how to configure S3, Route53, and Cloudfront to always use the root domain

Using Route53, how can I configure a Cloudfront enabled S3 site to always use a root/naked domain?
Take for example, well, a domain called example.com. First, I know one needs to create two buckets, www.example.com and example.com. Beyond this, it gets tricky when using Cloudfront and Route53.
Figured this out:
S3
Put the contents of your site in bucket example.com. Note the Endpoint URL. In my case, it's something like example.com.s3-website-us-east-1.amazonaws.com.
In Properties for example.com bucket, set 'Enable web hosting'
In properties for www.example.com bucket, set 'Redirect all requests to another host name' and Redirect all requests to set to example.com
CloudFront
Create a CloudFront distribution with origin: example.com.s3-website-us-east-1.amazonaws.com (note, when using CloudFront, the default origin options in the picklist appeared as example.com.s3.amazonaws.com, but it should be example.com.s3-website-us-east-1.amazonaws.com. The former is US Standard which is US east and should work, but I ran into issues).
Route53
For example.com hosted zone, create two DNS records (should already have an NS and SOA record if zone for example is on Route53):
1
Type: A
Name: (blank) - (therefore root/naked domain, example.com)
Alias: Yes
Alias Target: 'some cloudfront id'.cloudfront.net.
2
Type: CNAME
Name: www (therefore www.example.com)
Alias: No
Value: example.com.s3-website-us-east-1.amazonaws.com