3

I added the following entries in the HOSTS file.

127.0.0.1 abc.localhost.com
127.0.0.1 xyz.localhost.com

Using the VS2010 ASP.NET Development server I am unable to run or execute the website.

When browsing http://localhost:2687/TestProject/ it shows up the default.aspx page. But when accessing http://abc.localhost:2687/TestProject/ it shows a website cannot be found page.

Is there anything else to be done when setting up subdomain on localhost.

EDIT: To make this work I removed the .com and in IE-->Connections-->LAN uncheck everything. Subdomains with port works are correctly getting forwarded. Nothing else need to be configured.

2 Answers 2

2

Obvious mistake is that in your hosts file you have abc.localhost.com, whereas you are browsing to http://abc.localhost/folder

Not the same thing.

Not sure this will work as you intend anyhow. I would also recommend IIS Express, part of WebMatrix, which I think is still in beta, or just use IIS. IIS 7+ on Vista, W7, Server 2008 is all really easy to use.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. What did the trick was to set proxy settings to default.
2

Use IIS or IIS express, rather than Cassini. (For several reasons, which you can google or look for on stackoverflow)

With the IIS you can easily add a hostheader entry to you webapplication with just 2 clicks.

Be aware, that you are assigning both a Url and a port. So adding abc.localhost won't allow you to browse abc.localhost2687, just the default port (80). If you also want to browse to abc.localhost:2687 you need to a a hostheader entry according to that that Url and port.

This screenshot shows you the dialog to add hostheaders (the picture is from IIS 6, but in IIS 7 or IIS 7.5 it looks very similar)

enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.