0

I can access a default html page at '127.0.0.1' I've added an entry in Windows hosts file as

127.0.0.1 www.xyz.org xyz.org

When I've opened the URL www.xyz.org in a browser I've got my html page. But when I've changed the line to this

127.0.0.1 www.wikipedia.org wikipedia.org

And when I open www.wikipedia.org , I'm getting "This site cannot be reached,ERR_CONNECTION_REFUSED". The same is with www.wikiversity.org , www.wikiquote.org and several other wiki sites . What is wrong with this ??

Thanks.

1 Answer 1

1

Wikipedia (and its sister Wikimedia sites like Wikiversity) are protected with preloaded HSTS, meaning (among other things) your browser will always visit them via HTTPS. I assume your Web server is running via HTTP only, so when you try to connect to 127.0.0.1 via HTTPS, there's nothing to connect to and the connection fails.

Note that just enabling HTTPS on your Web server won't let you do what you want, since you don't have (and can't get) a valid certificate for either of those domains, and HSTS prevents you from bypassing an invalid certificate message. If you really want to take over those domains on your computer, you'd need to create your own root CA, add it to your trusted CA list, and sign your Web server's certificate with it.

If you're interested: HSTS preloaded list

2
  • So, maybe using an older browser that doesn't have these lists preloaded might work? Mar 1, 2017 at 5:54
  • That would work, but remember that browsers that are that old tend to have serious security vulnerabilities, so you'd need to somehow make sure you don't go to any site that you don't 100% trust the content of with it. Mar 1, 2017 at 5:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .