Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I bought a domain through a (cheap!) domain company and I want this domain to point to a folder on the server.

The story

I originally bought www.domain.com along with hosting

A few months down the line I bought www.domain2.com

I want www.domain2.com to point ------> to www.domain.com/folder

How do I do this? can it be done through DNS, Im quite new to this!

Help!

Can you please explain exactly the dns commands, or records i need to add, cause I really dont get DNS at all!

Thanks

share|improve this question

2 Answers 2

You don't do this through DNS. DNS only associates a name to an IP address -- what happens at that IP address is up to the service you are connecting on.

Your DNS options are:

  • set up an A record for www.domain2.com to be the same IP address as www.domain.com
  • set up a CNAME record for www.domain2.com to be "www.domain.com". CNAME is a DNS shortcut that says "look up this name instead and use that for an answer." This means if you ever move www.domain.com somewhere else, www.domain2.com will follow along without you having to do anything.

You then configure your web server to have a virtual host on the same IP address, bound to the name www.domain2.com, which emits a http-redirect to http://www.domain.com/folder -- this may or may not be possible depending on what kind of hosting you have for www.domain.com. If you are self-hosted, then you can set up the virtual host yourself. However, if you are not self-hosted, you will probably have to contact your hosting's help desk department to ask if, and how, this is possible.

share|improve this answer

You'd set up an 'a' record which points to the ip address of the server, and then configure the server to direct requests for the name of the new domain to point to the folder you want it to serve.

The actual procedure to achieve this varies depending on the web server your running. If your using apache 1.3 take a look at virtual hosts. And this is the doc for apache 2

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.