Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have an application which I've been playing around with on my Windows 2008 server. I have WordPress installed so that when I visit the server by it's IP address I can visit my hosted website.

The WordPress website works fine when I request the site by it's IP, but when I try to debug the application in visual studio it opens http://localhost:49219/, where I can see my website, but even after opening this port and trying to access my application over the net by my server's IP I get the following error:

Bad Request - Invalid Hostname

What is strange is that even on my server, I cannot visit the site by typing in

I'd like to try to get this application on the net but I really have no clue why I can refer to it using localhost but not by IP. Any suggestions?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

After playing around for some time, I think I figured it out. The service I was running was on visual studio's debug server, so it was probably redirecting the request for localhost on that port to itself, however probably can't be remapped in the same way. Everything worked correctly after the site was published.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.