0

I have created a launchrock.com page and I am directing signup.mydomain.com there using a CNAME record in the DNS. That works fine however now I want to direct root traffic there too, i.e. mydomain.com. How do I go about this?

Launchrock give instructions to change the IP address of the A record, however I don't want to do this since I have other subdomains in use, including beta.mydomain.com. (These subdomains need to continue operating as they currently do).

How do I do this? I'm not sure whether it's a DNS change or an Apache change.

I am using a recent version of Apache on Ubuntu on AWS EC2.

DatsunBing
  • 459
  • 4
  • 7
  • 17
  • possible duplicate of [Why can't a domain's root be a CNAME?](http://serverfault.com/questions/170194/why-cant-a-domains-root-be-a-cname) – MadHatter Jul 30 '14 at 08:22
  • @MadHatter, this doesn't help. I need to be able to redirect the root somehow. I don't care whether CNAME is involved or not... – DatsunBing Jul 30 '14 at 08:58
  • 1
    You already know how to do this: with an A record. You can't do it with a CNAME. There are no other options. – MadHatter Jul 30 '14 at 08:58
  • Surely that can't be the case. What about using mod_rewrite in Apache? – DatsunBing Jul 30 '14 at 09:05
  • @MadHatter, see answer below... – DatsunBing Jul 30 '14 at 09:22
  • That presumably means that **you've already got an A record defined for mydomain.com, and a webserver running at that address**. You kind of omitted to mention those details! But you are right that given that infrastructure, you can do this without any DNS changes. – MadHatter Jul 30 '14 at 09:26
  • @MadHatter If you read the second paragraph of my question you will get the full picture. – DatsunBing Jul 30 '14 at 12:12
  • I did; it makes no mention of an existing web server at the current A record for `mydomain.com`. However, I'm glad you've found a solution that works for you; you should probably accept your answer when the site permits it (that may take a day or two). – MadHatter Jul 30 '14 at 12:22

1 Answers1

0

As it turns out, the answer was simply to put a redirect command in the virtual host setup for the root host.

Redirect / http://signup.mydomain.com/
DatsunBing
  • 459
  • 4
  • 7
  • 17