Use of the HOSTS File

  • Thread starter Thread starter Arthur Shapiro
  • Start date Start date
A

Arthur Shapiro

I'm well aware of the use of the HOSTS file to redirect URLs to specific IP
addresses - typically the loopback address to eliminate various nasty sites
such as Doubleclick.

But is there a way to get a finer gradation than the IP address? Can I cause
redirection to a specific page within the site represented by the IP address?

Let me get specific. I'm having trouble here at work with the nighttime
cleaning crew using my PC to access various foreign language pornographic
sites. The company will be installing some wireless cameras this afternoon,
and has encouraged me not to lockdown my machine in order to keep the culprit
"trained" to use this computer while the equipment was being procured.

Presumably we'll know his/her identity within a day or two. Then, as the list
of visited sites is fairly constant, I'll beg the company's indulgence to have
some fun, if it's possible. I want to redirect most of those sites to a
specific page on my own site which says, in the language in question:

Attention <person's name>. We have detected that you have been using our
computers to access illegal material. Please remove ALL your clothing and
walk to the front of the building with your hands over your head. The
Immigration and Naturalization Service will be waiting for you.

But how to I direct those addresses to this particular page, and not the
overall IP address of the site, which brings up the administrative login /
control page?

Art
 
Arthur said:
I'm well aware of the use of the HOSTS file to redirect URLs to specific
IP addresses - typically the loopback address to eliminate various nasty
sites such as Doubleclick.

But is there a way to get a finer gradation than the IP address? Can I
cause redirection to a specific page within the site represented by the
IP address?

Let me get specific. I'm having trouble here at work with the nighttime
cleaning crew using my PC to access various foreign language pornographic
sites. The company will be installing some wireless cameras this
afternoon, and has encouraged me not to lockdown my machine in order to
keep the culprit "trained" to use this computer while the equipment was
being procured.

Presumably we'll know his/her identity within a day or two. Then, as the
list of visited sites is fairly constant, I'll beg the company's
indulgence to have some fun, if it's possible. I want to redirect most
of those sites to a specific page on my own site which says, in the
language in question:

Attention <person's name>. We have detected that you have been using our
computers to access illegal material. Please remove ALL your clothing and
walk to the front of the building with your hands over your head. The
Immigration and Naturalization Service will be waiting for you.

But how to I direct those addresses to this particular page, and not the
overall IP address of the site, which brings up the administrative login /
control page?

You can't with just modifying the HOSTS file. You could install a proxy,
either software or hardware, that could be configured with rules specific to
the sites they visit, or all sites if you want. The rules would then
replace the content being delivered to the browser with whatever you want,
or insert the redirect if that is your preference.
 
Back
Top