tags:

views:

38

answers:

4

I have a website http://www.domain1.com. Is it possible to register a second domain, http://www.domain2.com, and have it point to http://www.domain1.com/SecondDomainHere? If someone types domain2.com, I don't want them to be able to just remove the /SecondDomainHere part and be at the main website. This is for my personal use, not a business appplication, and I'd prefer to do this for awhile before getting another hosting account.

Is this technically possible? Is this done and is it acceptable? What is this called?

A: 

Yes it is possible, just look for "aliasing" in your favorite http server.

Unknown
A 301 Redirect will allow them to remove the /SecondDomainHere part to get to the main website. Solution fails the question's requirements.
ceejayoz
Oh I missed that part of the question. I revised my answer.
Unknown
+1  A: 

You need to set domain2.com to poiint to the same nameservers as domain1.com.

Then, on your server, set up a "Virtual Private Server". This will basically say "when a request comes to this site, if it's for domain1.com, show folderX, if it's for domain2.com, show folderY". I'm assuming Apache here but similar terminology should apply for Windows etc.

If you're on a shared web host... you may be out of luck. The best you could do is either redirect or set up a "frame redirect", where domain2.com has a frame holding domain1.com/SecondDomainHere. Problem with that is domain2.com/page.html will not link to domain1.com/SecondDomainHere/page.html AFAIK.

DisgruntledGoat
In Apache, this is called a VirtualHost.
ceejayoz
A: 

If you use Apache you can also use mod_rewrite along with virtual hosts to get this kind of behviour. Assuming of course that you can actually use .htaccess (and configure multiple domains per account) with your hosting provider.

Matthew Iselin
A: 

Definitely possible, as others have mentioned. Knowing which web server you're using would help narrow down the answer.

Chris Stewart
This is a shared windows server. Hosting provider is hostmysite.com
Scott