Score:0

How to redirect an old subdomain with Route53

id flag

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

Tim avatar
gp flag
Tim
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.
Costa Michailidis avatar
id flag
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?
Tim avatar
gp flag
Tim
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.
Costa Michailidis avatar
id flag
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.
Tim avatar
gp flag
Tim
I'll provide an answer so you can mark it done. Feel free to provide your own detailed answer instead.
Score:1
gp flag
Tim

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.

Costa Michailidis avatar
id flag
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 : )
Tim avatar
gp flag
Tim
You could add your own answer to give details, and change the correct answer from yours to mine, if you like.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.