I run a web server e.g. python -m SimpleHTTPServer 80
or python -m http.server 80
(which of those depends on python version), and I do echo blah >index.html
to write an index.html with the text blah in it.
C:\Python27>start python -m SimpleHTTPServer 80
Serving HTTP on 0.0.0.0 port 80 ...
and it works
C:\Python27>curl 127.0.0.1
blah
C:\Python27>
Chrome picks it up
http://127.0.0.1 displays blah
My hosts file c:\windows\system32\drivers\etc\hosts
has these lines
127.0.0.1 rice.com
127.0.0.1 www.rice.com
And the hosts file works, for rice.com
in that if I tell chrome to go to http://rice.com, then it says "This site can’t be reached rice.com refused to connect."
But it's not picking up the web server when going through the hosts file!
So I can access http://127.0.0.1 in chrome and that works
but when I do http://rice.com it doesn't go to rice.com so the hosts file is doing something, or rather, it's having some effect.
but chrome doesn't get from http://rice.com to http://127.0.0.1
firefox also.
That was windows 7. I tried it on another laptop that happens to be running windows 10, and same thing happens.
I start the web server python -m http.server 80
And same thing.. If I do http://127.0.0.1 it sees it(contents of index.html). If I do http://rice.com then it says "site can't be reached. refused to connect".