Mobile app version of vmapp.org
Login or Join
Carla537

: CNAME to S3 returns the S3 URL I've setup a static website on S3 under a www.mydomain.com bucket. I also created a CNAME record for it in Namecheap looking like this: Type: CNAME Record Host:

@Carla537

Posted in: #AmazonS3 #Cname #Dns #Namecheap

I've setup a static website on S3 under a mydomain.com bucket. I also created a CNAME record for it in Namecheap looking like this:


Type: CNAME Record
Host: www
Value: mydomain.com.s3-website-ap-southeast1.amazonaws.com

It redirects correctly when I go to mydomain.com but the URL being displayed is of S3 and not my domain. If it helps, here's some output from dig:

;; ANSWER SECTION: mydomain.com. 1177 IN CNAME mydomain.com.s3-website-ap-southeast-1.amazonaws.com. www.mydomain.com.s3-website-ap-southeast-1.amazonaws.com. 60 IN CNAME s3-website-ap-southeast-1.amazonaws.com.
s3-website-ap-southeast-1.amazonaws.com. 5 IN A 54.231.242.137


When I checked the headers from curl, I got a 301.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Carla537

2 Comments

Sorted by latest first Latest Oldest Best

 

@Correia994

Figured it out - in have two buckets in S3 - mydomain.com and mydomain.com. mydomain.com is where the site is, and I set mydomain.com to redirect to mydomain.com.s3-website-ap-southeast1.amazonaws.com... I moved the files to mydomain.com and removed the redirect.

10% popularity Vote Up Vote Down


 

@Kaufman445

The reason you see a 301 in your curl is because mydomain.com redirects to mydomain.com from the S3 endpoint for mydomain.com. This is a common configuration when using S3 for your static website. The question is how do you have mydomain.com configured in your DNS zone at Namecheap? If the browser is displaying the S3 url I can only assume that the root domain is configured as a 301/302 URL redirect record to point to your S3 endpoint. If that is the case I would ask NameCheap if they have any type of "CNAME like" record that will function as a CNAME but will allow you to configure it on your root domain.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme