Route53 Subdomain Redirect – How to Redirect an Old Subdomain with Route53

amazon-route53amazon-web-servicescname-record

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

Best Answer

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.