How to redirect S3 hosted static site from Domain A to Domain B in AWS Cloudfront setup?
up vote
-1
down vote
favorite
My problem
I'm trying to 301 redirect myS3 hosted domain-a.com to domain-b.com in my SSL-secured AWS Cloudfront setup. I cannot figure out how to achieve this. Instead both domains now serve the Cloudfront/S3 Bucket content.
My use case
Before switching to Cloudfront I used to handle redirects with S3's static website hosting options by redirecting the secondary domain bucket to the primary domain bucket.
In order to secure my S3-hosted static site with SSL certificates I made the switch to Cloudfront.
SSL certificates work fine, but because now both domains point to the cloudfront distribution (see screenshots below) I can access the same content on both domains. This does not only lead to duplicate content but also confuses users and is not really the best UX.
Route 53 and Cloudfront config for both domains
- Route 53 points to a single Cloudfront distribution for both domain-a.com and domain-b.com
- Cloudfront points to the domain-b.com S3 bucket
How can I redirect domain-a.com to domain-b.com so as to only have one primary domain which my users see and use? Can this be achieved through Route 53 DNS settings or do I have to edit my Cloudfront configuration?
amazon-web-services amazon-s3 dns amazon-cloudfront amazon-route53
add a comment |
up vote
-1
down vote
favorite
My problem
I'm trying to 301 redirect myS3 hosted domain-a.com to domain-b.com in my SSL-secured AWS Cloudfront setup. I cannot figure out how to achieve this. Instead both domains now serve the Cloudfront/S3 Bucket content.
My use case
Before switching to Cloudfront I used to handle redirects with S3's static website hosting options by redirecting the secondary domain bucket to the primary domain bucket.
In order to secure my S3-hosted static site with SSL certificates I made the switch to Cloudfront.
SSL certificates work fine, but because now both domains point to the cloudfront distribution (see screenshots below) I can access the same content on both domains. This does not only lead to duplicate content but also confuses users and is not really the best UX.
Route 53 and Cloudfront config for both domains
- Route 53 points to a single Cloudfront distribution for both domain-a.com and domain-b.com
- Cloudfront points to the domain-b.com S3 bucket
How can I redirect domain-a.com to domain-b.com so as to only have one primary domain which my users see and use? Can this be achieved through Route 53 DNS settings or do I have to edit my Cloudfront configuration?
amazon-web-services amazon-s3 dns amazon-cloudfront amazon-route53
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
My problem
I'm trying to 301 redirect myS3 hosted domain-a.com to domain-b.com in my SSL-secured AWS Cloudfront setup. I cannot figure out how to achieve this. Instead both domains now serve the Cloudfront/S3 Bucket content.
My use case
Before switching to Cloudfront I used to handle redirects with S3's static website hosting options by redirecting the secondary domain bucket to the primary domain bucket.
In order to secure my S3-hosted static site with SSL certificates I made the switch to Cloudfront.
SSL certificates work fine, but because now both domains point to the cloudfront distribution (see screenshots below) I can access the same content on both domains. This does not only lead to duplicate content but also confuses users and is not really the best UX.
Route 53 and Cloudfront config for both domains
- Route 53 points to a single Cloudfront distribution for both domain-a.com and domain-b.com
- Cloudfront points to the domain-b.com S3 bucket
How can I redirect domain-a.com to domain-b.com so as to only have one primary domain which my users see and use? Can this be achieved through Route 53 DNS settings or do I have to edit my Cloudfront configuration?
amazon-web-services amazon-s3 dns amazon-cloudfront amazon-route53
My problem
I'm trying to 301 redirect myS3 hosted domain-a.com to domain-b.com in my SSL-secured AWS Cloudfront setup. I cannot figure out how to achieve this. Instead both domains now serve the Cloudfront/S3 Bucket content.
My use case
Before switching to Cloudfront I used to handle redirects with S3's static website hosting options by redirecting the secondary domain bucket to the primary domain bucket.
In order to secure my S3-hosted static site with SSL certificates I made the switch to Cloudfront.
SSL certificates work fine, but because now both domains point to the cloudfront distribution (see screenshots below) I can access the same content on both domains. This does not only lead to duplicate content but also confuses users and is not really the best UX.
Route 53 and Cloudfront config for both domains
- Route 53 points to a single Cloudfront distribution for both domain-a.com and domain-b.com
- Cloudfront points to the domain-b.com S3 bucket
How can I redirect domain-a.com to domain-b.com so as to only have one primary domain which my users see and use? Can this be achieved through Route 53 DNS settings or do I have to edit my Cloudfront configuration?
amazon-web-services amazon-s3 dns amazon-cloudfront amazon-route53
amazon-web-services amazon-s3 dns amazon-cloudfront amazon-route53
asked 12 hours ago
wntrmt
617
617
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Create a separate bucket for domain-a.com, configure that in your CloudFront and apply the redirect rules to point it to domain-b.com.
Check the picture below on how to set the redirect.
Hope it helps.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Create a separate bucket for domain-a.com, configure that in your CloudFront and apply the redirect rules to point it to domain-b.com.
Check the picture below on how to set the redirect.
Hope it helps.
add a comment |
up vote
0
down vote
Create a separate bucket for domain-a.com, configure that in your CloudFront and apply the redirect rules to point it to domain-b.com.
Check the picture below on how to set the redirect.
Hope it helps.
add a comment |
up vote
0
down vote
up vote
0
down vote
Create a separate bucket for domain-a.com, configure that in your CloudFront and apply the redirect rules to point it to domain-b.com.
Check the picture below on how to set the redirect.
Hope it helps.
Create a separate bucket for domain-a.com, configure that in your CloudFront and apply the redirect rules to point it to domain-b.com.
Check the picture below on how to set the redirect.
Hope it helps.
answered 11 hours ago
Kannaiyan
5,67411942
5,67411942
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53416119%2fhow-to-redirect-s3-hosted-static-site-from-domain-a-to-domain-b-in-aws-cloudfron%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown