0

I've redirected an old subdomain blog.mysite.com to my homepage mysite.com with a CNAME record in Route53, but.... it doesn't work. I get no server response at all.

Is there something I'm doing wrong?

Update: Now I get a 403 from Cloudfront.

enter image description here

CNAME Record

5
  • 1
    It's difficult to help when you redact the key information required for problem solving. Also note that sending a request to a different server doesn't mean that server will accept the request or send back useful content, you may need to have it listen for requests to the old domain and redirect / forward the request.
    – Tim
    Feb 22, 2022 at 0:42
  • Sorry, I've been punished for using real URL's back at Stackoverflow. I see, so the receiving server is thinking it needs to serve up for the original URL? Is there a way to redirect at the DNS level? A DNS record that says, 'hey the blog subdomain just reroutes to the www subdomain.' Meaning, can I rewrite the request with DNS before passing it? Feb 22, 2022 at 14:18
  • 1
    A receiving server can effectively have a wildcard accept, accepting and servicing any request that comes in, but that's not the default. If the request is http it's fairly easy to do a wildcard redirect in Nginx / Apache, but if it's https the connection needs to be terminated. My suggestion is to configure your web server to accept that domain, which may include presenting the correct https certificate for the old domain, then having the web server send a permanent redirect - test it with a temporary redirect first. This may or may not be your core problem, but it will be a problem.
    – Tim
    Feb 22, 2022 at 17:02
  • Alright! All working now. It involved using S3 for a redirect, putting Cloudfront in front of that, and routing an A record to the Cloudfront site. Feb 22, 2022 at 21:49
  • 1
    I'll provide an answer so you can mark it done. Feel free to provide your own detailed answer instead.
    – Tim
    Feb 22, 2022 at 21:51

1 Answer 1

1

I suspect the problem is you are routing a request to a server that is not configured to accept requests for that domain.

A receiving server can effectively have a wildcard accept, accepting and servicing any request that comes in, but that's not the default. If the request is http it's fairly easy to do a wildcard redirect in Nginx / Apache / S3 hosting, but if it's https the connection needs to be terminated.

My suggestion is to configure your web server to accept that domain, which may include presenting the correct https certificate for the old domain, then having the web server send a permanent redirect - test it with a temporary redirect first. There are multiple other ways to do this, including the S3 static website option you mentioned in the comment above.

2
  • Thanks! That's the approach I ended up taking. If anyone has this issue and needs to details, let me know. It's like 19 steps on AWS, as with all things AWS : ) Feb 24, 2022 at 0:11
  • You could add your own answer to give details, and change the correct answer from yours to mine, if you like.
    – Tim
    Feb 24, 2022 at 3:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .