How can I block a certain website using hosts file even if I'm connected to a VPN?

In order to block some certain sites, I use the following codes in my hosts file:

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost
127.0.0.1 http://www.hamdardi.net/  

But that works only when I'm not connected to a VPN.
How can I block a certain website using hosts file even if I'm connected to a VPN?
please avoid suggestions like leechblock for firefox, stayfocused for google chrome. I want a solution that works for all browsers installed on my computer (IE, firefox, google chrome) that doesn't let me to access and edit the blocking settings while the sites are blocked.
I have tried a lot of ways like localfilter, BinarySwitch Eclipse, etc. But I've always found a way to sneak out.
This time I wanna block the sites using hosts file and then set a random password on the file for the administrator of the computer (not the SYSTEM) and give this password to someone else


Hosts file should always work - VPN or not. Drop the http protocol. These entries should be sufficient:

127.0.0.1 www.hamdardi.net

127.0.0.1 hamdardi.net

Edit: Useful debugging guide: https://serverfault.com/a/452269