I want to test some subdomain features in an asp.net site. I read just to edit the hosts file and add 127.0.0.1 subdomain.domain.com and that should work.
But mine seems to not. I have flushed the dns, restarted, tried new browsers and still get error 500.
When I normal run the asp.net site from Visual Studio it goes to http://localhost:17365/
. How do I get the IP address for this?
I guess I don't get the whole picture and missing some pieces.
I ran netstat -n and see that the site is running on[::1]:17365 maybe thats why its not working under ipv4?
The solution is very simple.
After you have edit your host
files adding a line as:
127.0.0.1 subdomain.domain.com
you run your site, the personal web starts and you get on your browser this
http://localhost:[PortNumber]/
(eg: http://localhost:17365/
)
just change it to
http://subdomain.domain.com:[PortNumber]/
(eg:http://subdomain.domain.com:17365/
)
with your hand, type it on the url on your browser, and it will work.
In visual studio when you go to run the site first change in the Website Properties > Use Dynamic Ports
toFalse
, then set the Port Number
to80
, then run it.
It will by default launch http://localhost:80
, however then in your browser visit subdomain.domain.com
in your browser it will point to your debugging instance of your site (assuming you've still got that 127.0.0.1 subdomain.domain.com
in your hosts file).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With