By using AWS re:Post, you agree to the Terms of Use

Host S3 website with on-premises DNS server without Route53


I have an S3 bucket set up for "Static Website Hosting", a CloudFront distribution with our own SSL certificate and allowing Host header, a Global Accelerator IP address attached to an Application Load Balancer.

The Application Load Balancer does a 301 redirect to the S3 bucket. I know that you can set an EC2 instance as a target group and forward to that to preserve the original URL.

Can you also preserve the original URL using this method of 301 redirect to a Cloudfront distribution tied to an S3 bucket?

1 Answer
Accepted Answer

I'm a little unclear about what you're trying to do here.

If I follow correctly: Browser navigates to (hosted on ALB/EC2) which then redirects to (hosted on CloudFront/S3). You're looking for a way such that the browser doesn't see once redirected but instead?

By setting up (say) on CloudFront you can then pull static content from any S3 bucket you like. Then the redirect would be to But you can't have the same hostname used for both CloudFront and ALB - well, not without randomly sending browser to either location.

However, the subject of your question mentions Route 53. In this case, if you're hosting content on you do need Route 53 in order to assign the "apex record" to a specific endpoint (ALB, CloudFront, whatever). If you were redirecting from to or then an on-premises DNS will work fine. Naturally, my next question would be "why not use Route 53 given it is a fully managed and highly available service".

profile picture
answered 6 months ago
  • I wanted to keep the original domain entered into the browser while serving up content from the S3 bucket. We did not want to use Route53 as that would require us to dedicate a portion of our IP address space to Route53 and that may change in the future. The question was incomplete and should have provided more detail. You were right in guessing what I was actually trying to do. In this case, I think we should use ALB/EC2 forwarding to an EC2 managed by Elastic Beanstalk.

  • I'm not sure why using Route 53 means dedicating a portion of your IP address space to Route 53. The only restriction here is that apex records are assigned to Route 53 Alias records which necessitates those resource being in AWS. But that has nothing to do with IP addressing.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions