Block Websites and Redirect to Html File


S

Steve

I want to use the Host file in Windows XP to block sites from access. I
understand the method to redirect it back to the local ip but I am
wondering if anyone has redirected them to an html page on the
computer. Basically I want to not show the default "Page not found"
page but a customized page stating the website is blocked. This would
prevent questions of is it an internet problem or just a blocked site.
I am guessing I need to redirect to the host ip and it is just a limit
of the logic within host but thought maybe someone else has found a
work around.

Anyone know of one? Thanks!
 
Ad

Advertisements

D

David H. Lipman

From: "Steve" <[email protected]>

| I want to use the Host file in Windows XP to block sites from access. I
| understand the method to redirect it back to the local ip but I am
| wondering if anyone has redirected them to an html page on the
| computer. Basically I want to not show the default "Page not found"
| page but a customized page stating the website is blocked. This would
| prevent questions of is it an internet problem or just a blocked site.
| I am guessing I need to redirect to the host ip and it is just a limit
| of the logic within host but thought maybe someone else has found a
| work around.
|
| Anyone know of one? Thanks!

You can't use the etc/hosts table to redirect an alias to a local file, just to a set IP.
Misdirection is usually set to the diagnostic responder address; 127.0.0.1
 
S

Sharon Franks

Yes you can if you have IIS installed, configured, and running. If so then
just point it to your IP. If you are not running IIS then you can point them
to any external address of your choice. It does not have to be 127.0.0.1

--

Sharon Franks
MCC group
Microsoft Certified Solutions Developer (MCSD)
Microsoft Certified Trainer (MCT).
 
Ad

Advertisements

S

Steve

Thanks Sharon -

That will work. For anyone else interested here is a quick way of
blocking sites using the host file.

1. Setup one workstation with IIS

2. Create a webpage indicating blocked site found. In my case it shows
"blocked site, You have entered a website address that is prohibited
from access by XXXX Company. Sites that contain material not suited or
related to XXXX business activities are locked from access over the
intranet."

3. Go to the workstation and modify the host file in
C:\windows\drivers\ect
4. Add line of code XXX.XXX.XXX.XXX www.domain.com

127.0.0.1 localhost
192.168.0.122 www.nowhere.com

5. Save the host file on the workstation

6. Open internet explorer and type www.nowhere.com on the address bar.
This will redirect them to your machine with IIS running and bring up
the webpage "blocked sites ...."

Of course if you have a larger network it might be better to invest in
a software package to handle the blocking of sites.

Thanks again Sharon!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top