views:

51

answers:

3

Hello!

If I have a website at myFirstDomain.com/dir/, is it possible to get mySecondDomain.com to point to myFirstDomain.com/dir/ so that when users browse at the directed site, they only see mySecondDomain.com/potentialSubDirFromMyFirstDomain/ or how does it work?

A: 

Hi Zoloman,

Firstly, I think your going to need direct access to the web server... are you using a VPS/Dedicated Server or Shared Hosting?

Windows Server, Linux?

Dal
Thank you for answering so quickly! It's a dedicated server, I think it's running a Windows Server 2003 at the moment since they're running ASP.NET on it. My employer is working on giving me admin )
Zolomon
A: 

Ok good.

Well what you'll need to do is make use of IIS 6.0 Host Header Filter.

Essentially in IIS you will have your default web site which is currently serving myFirstDomain.com.

With Host Headers, we can add another web site which is mapped to the location of your subdirectory and will only be visible if the user enters via 'mySecondDomain.com'.

So in a nutshell we are getting IIS to host multiple sites on one box. I'm not too familiar with the process in IIS 6.0 since all I use is IIS 7.0 which is not available on Windows Server 2003.

However, the following links should help you implement it in IIS 6.0:

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/b77cf015-017f-489c-9b5b-65ca4a679392.mspx?mfr=true

http://forums.iis.net/t/1120787.aspx

http://www.goarticles.com/cgi-bin/showa.cgi?C=188629

The idea is that when a user types 'mySecondDomain.com' it will add this 'host header' into the body of the HTTP request from the browser to IIS, IIS will then read this value and check to see if any of the website(s) contain a match for the host header and redirect the user to the appropriate website, thus mySecondDomain.com will appear as though its on its own server (which it technically is anyway.)

From what I remember the host header attribute only exists in the HTTP 1.1 protocol, HTTP 1.0 does not support it and will not send the host header to IIS which means the default web site will be displayed instead...(regardless of what domain you come in from). I'm pretty sure most browsers are using HTTP 1.1 though.

A safer way would be to bind each web site via IP address... but for this you will need multiple internet ip addresses on one box - I've never had a problem with host headers though!

Dal
A: 

It is not possible at all with the DNS. You will have to set up a HTTP redirection (no experience with IIS so I cannot help here, just suggest you to drop the "dns" tag).

bortzmeyer