Localhost 's subdomain with port numbers, how to?
We know that to add a subdomain for localhost, we open and edit the host file by adding lines such as:
127.0.0.1 localhost
127.0.0.1 开发者_如何学编程 abc.localhost
127.0.0.1 xyz.localhost
My problem is that: if I browse abc.localhost:88 I get the below error:
Bad Request - Invalid Hostname HTTP Error 400. The request hostname is invalid.
Why doesn't the URL abc.localhost:88 browse to 127.0.0.1:88 ?
Please help.
Because you need to an entry for abc.localhost
to your hosts file. If you already have, then make sure that your webserver is listening on port 88.
If you are using IIS, make sure that you have added a binding to the correct hostname (abc.localhost).
As well as putting the entry in the client's hosts file, you will need to add the appropriate host header abc.localhost
to the IIS site that's configured for port 88.
In IIS manager (inetmgr.msc), website properties, website tab, advanced, and add your host header there.
精彩评论