What is the simplest way to set up a 307 from one apex domain to another on AWS Route53?
- thecontent.com - the content
- www.thecontent.com - should 307 to thecontent.com
- otherdomain.net - should 307 to thecontent.com
Here's what I've tried:
- Create hosted zone for thecontent.com
- Create AWS bucket with the content and cloudfront distribution.
- Setup an apex record: A ALIAS d1waasdf05wj5.cloudfront.net.
- So far, visiting all these URLs works
- Create a public bucket www.content.com with "Static website hosting".
- For 301, "Redirect Requests"
- For 307, "Use this bucket to host a website"
- Set "Redirection rules"
Redirection rules
<RoutingRules>
<RoutingRule>
<Redirect>
<Protocol>https</Protocol>
<HostName>thecontent.com</HostName>
<HttpRedirectCode>307</HttpRedirectCode>
</Redirect>
</RoutingRule>
</RoutingRules>
So far, this works. wget --max-redirect 0 http://bucket-endpoint-url
shows a 307
Setup www.thecontent.com -> thecontent.com
- I can setup a CNAME easy to forward www->apex, but that won't work for apex->apex. An apex can't have a CNAME.
- So, I read to setup an A record with an ALIAS to the bucket, but the bucket doesn't show up in the alias dropdown...
I get "Alias Target contains an invalid value." from these values:
Name: www, Type: A, Alias: Yes, Alias Target:
- http://www.donotlitterpeople.org.s3-website-us-east-1.amazonaws.com
- www.thecontent.com.s3-website-us-east-1.amazonaws.com
- www.thecontent.com.
- www.thecontent.com
This A record for the www subdomain would be the same as I'd use on the other domain, right? What am I missing?