Combining an A record with a subdomain redirect


#1

I have an A record pointing to my site’s host (Zippykid) for my root domain aoteastudios.com. I would also like blog.aoteastudios.com to redirect to aoteastudios.com.

I tried adding a CNAME record but that didn’t work. According to Zippykid, I either need to do something on the Dreamhost side to redirect the subdomain to the primary, or otherwise I need to point nameservers at Zippykid.

Is either of those a viable option, or is there something else I can do to make it work?

I’m not quite sure what configuration changes to make for either of those, so some instructions would be great.

Thank you.


#2

It looks like the CNAME is correct from what you describe.

;; ANSWER SECTION:
blog.aoteastudios.com. 14400 IN CNAME aoteastudios.com.
aoteastudios.com. 14400 IN A 50.56.48.7

What wasn’t working?

Keep in mind that a CNAME alias in DNS isn’t going to change the Host header that a browser sends as part of the HTTP 1.1 request. If the destination web server is rejecting requests blog.aoteastudios.com, you’ll need to have the browser ask for aoteastudios.com.

  1. Delete the CNAME record in DNS.
  2. From the control panel, select “Add New Domain /Sub-Domain”.
  3. Scroll down to the “Redirect” section.
  4. Add an entry for the domain “blog.aoteastudios.com” pointing to “http://aoteastudios.com/”.

This will add a virtual host on DH’s shared web server that will return a 302 redirect and the client browser will access the primary server with the right headers.


#3

This is exactly what I needed, thank you!

The CNAME was working but due to Zippykid configuration it wasn’t enough, so I needed another solution. The redirect works great.