Multiple Site with Host Name problem

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
3/28/2009 3:02:53 PM
Gravatar
Total Posts 3

Multiple Site with Host Name problem

Hi,

I tried to use mutliple site with host name feature.
I followed the document about it but in the browser
I always see the master site, never the child site.
I started to debug and found the WebUtils.GetHostName()
always give me "localhost". (I use VS2008 devserver on XP,
sqlite, latest 2.2.9.8). I checked other than SERVER_NAME
and I found HTTP_HOST is give me the child host name.
So I modified the code and after it started to go properly
on my developer machine.

Is my fix correct? Will be work on an IIS server?

Regards,

Zoltan

3/29/2009 6:51:36 AM
Gravatar
Total Posts 18439

Re: Multiple Site with Host Name problem

There is nothing wrong with the code,if you change it it may not work correctly.

You need to understand what host names are and how they are resolved to ip addresses by DNS or by the hosts file on your machine located at c:\Windows\System32\drivers\etc\hosts

You will see there

127.0.0.1     localhost

you can add others like:

127.0.0.1   somearbitraryhostname

This will help you testing but in production it will be based on DNS servers resolving the host names.

So if you make a web url http://localhost/ then WebUtils.GetHostName() is going to return localhost and if you make a request http:/somearbitraryhost then it will return somearbitraryhost

But VS Web server is not going to respond to 2 host names, its going to use localhost:someport

If you want to test host names you should use IIS not the VS web server.

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.