Is it possible to redirect a subdomain to a different domain (behind CloudFront distribution)?

Viewed 283

We own two different domains and manage them in Route 53, to keep things simple I'll refer to them as example.com and secondary.com. Originally we had three CloudFront distributions with the following alternate domain names (CNAMEs), all have SSL certificates as well-

  1. general.example.com
  2. whatsnew.example.com
  3. help.secondary.com

Since we're retiring example.com we've been trying to redirect general.example.com & whatsnew.example.com to help.secondary.com. For now the CloudFront distributions for #1 and #2 above have been disabled. Following the below guide I was able to redirect the root domain (example.com) to help.secondary.com.

AWS Doc on redirecting domains

Currently the Route 53 root record for the example.com domain points to an S3 bucket named after it per AWS' doc.

Record name Type Value Error
example.com A s3-website-us-east-1.amazonaws.com. none: redirects successfully

However when I try this for general & whatsnew (these have their own S3 buckets as well) the redirection fails with the only error code being ERR_CONNECTION_TIMED_OUT. Below are other changes I've tested in Route 53, through an incognito Chrome browser, and their results.I get the SSL errors are due to the difference in domains but I'm not understanding how the same config works for example.com and not its subdomains. May not matter but the secondary.com domain lives in a different AWS account, which we also own. Are these redirections possible?

Record name Type Value Error
general.example.com CNAME example.com ERR_CONNECTION_TIMED_OUT
general.example.com CNAME help.secondary.com ERR_SSL_PROTOCOL_ERROR
general.example.com CNAME randomstring.cloudfront.net (CloudFront domain name for help.secondary.com) ERR_SSL_PROTOCOL_ERROR
0 Answers
Related