trying to add a new entry in windows 10 hosts file

just tried to add a new entry to my windows hosts file so that instead of using this:

to launch my wordpress site, I can just do something like this:

This is what my c:\Windows\System32\Drivers\etc\hosts file looks like:

127.0.0.1::8085 widget.local
localhost::8085 widget.local

Rebooted my machine after making the change. But widget.local doesn't work.

I also tried this:

127.0.0.1:8085 widget.local
localhost:8085 widget.local

Should I be able to do this? If so, can you tell me what I've done wrong?

Thanks.

1

1 Answer

Should I be able to do this?

No. Host files do not contain port numbers.

The hosts file contains lines of text consisting of an IP address in the first text field followed by one or more host names. Each field is separated by white space – tabs are often preferred for historical reasons, but spaces are also used. Comment lines may be included; they are indicated by an octothorpe (#) in the first position of such lines.

Source: hosts (file) - Wikipedia

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like