Setting subdomains on Localhost

1

I'm trying to test a multi-tenant application locally by setting a subdomain on localhost.

The application is currently running on localhost:5252.

In my hosts file I added the following:

127.0.0.1       contoso.localhost

and then in IIS on my default Web Site, I added a binding to contoso.localhost, pointing to that same port.

All I ever get when navigating to contoso.localhost is a blank IIS page though.

What am I doing wrong?

RobVious

Posted 2013-11-04T23:38:31.427

Reputation: 111

1Looks like you did it right, do you have any log files? And what happens when you goto http:\\contoso.localhost:5252? – Alex – 2013-11-04T23:47:31.963

@Alex I get the default IIS page, even if I specify the port. What log files should I look at? Total noob here :/ – RobVious – 2013-11-05T00:05:58.090

Answers

0

You added it to your hosts. You still have to set it up in your web-server, like in Apache.
That's why you get a blank page, Apache (for example) redirects you back.

Apache

Posted 2013-11-04T23:38:31.427

Reputation: 14 755

I tried setting it up in IIS - I added a binding for contoso.localhost at port 5252, still not working though. – RobVious – 2013-11-04T23:45:24.967