hosts file redirection...

Posted on 2004-04-24
Medium Priority
Last Modified: 2011-09-20
I have read a little about using the hosts file to block websites, and have used this method as well. But I would like to know if it is possible to have the hosts file point to a file on the local hard drive if the user visits a web site that has been entered into the host file. This way you could give a customized messaged instead of the server not found page. In some cases the user could keep trying different addresses, and different methods to get to the site maybe even finding one you haven't blocked if they didn't know it was blocked and for a good reason.

 ie.\ [path to folder] \blocked.htm     www.gator.com

 Thanks for your time and "greater than mine" knowledge,
Question by:Ryan Bennett
  • 2
LVL 58

Accepted Solution

Pete Long earned 1000 total points
ID: 10909293
if your 2k or XP and you have IIS installed this will happen anyway :) just point iis to a web page you have prepared and just typing will direct to it, so will your host file, WITHOUT DOING ANYTHNG to it :)

Install IIS on XP

Installing IIS
You can install IIS, add optional components, or remove optional components for IIS by using the Add/Remove Programs dialog box in Control Panel. IIS requires that you install certain software on the computer prior to installation. Review the IIS Software Checklist below before installing IIS.

IIS Software Checklist
Before you install IIS, you need to install the Windows TCP/IP Protocol and Connectivity Utilities.

The following optional components are recommended:

The Domain Name System (DNS) service installed on a computer in your intranet. If your intranet is small, you can use Hosts or Lmhosts files on all computers in your network. This step is optional, but it allows users to use friendly text names instead of IP addresses. On the Internet, Web sites typically use DNS. If you register a domain name for your site, users can type your site's domain name in a browser to contact your site.
For security purposes, Microsoft recommends that you format all IIS drives with NTFS.
Microsoft FrontPage to create and edit HTML pages for your Web site. FrontPage is a WYSIWYG editor that provides a friendly, graphical interface for tasks such as inserting tables, graphics, and scripts.
Microsoft Visual InterDev to create and develop interactive Web applications.
For more information on Windows TCP/IP Protocol and Connectivity Utilities, DNS, or NTFS security, see your Windows XP Professional online documentation.

IIS Installation
During installation, IIS installs optional components like Common Files, Documentation, and the Internet Information Services snap-in. You can choose not to install the optional components; however, deselecting specific components can decrease IIS functionality or disable IIS services. If you are unfamiliar with the optional components and how they affect IIS, install IIS with the default settings. After you install IIS, you can view Installing IIS Optional Components in the IIS online documentation for more information.

To install IIS, add optional components, or remove optional components

Click Start, click Control Panel, and click Add or Remove Programs.
Click Add/Remove Windows Components. The Windows Components Wizard appears.
Follow the on-screen instructions to install, remove, or add components to IIS.

If you upgrade from a Windows NT 4.0 Workstation that has IIS installed to Windows XP Professional, IIS is installed by default. If IIS was not installed on the Windows NT 4.0 Workstation, you will need to install IIS manually.
Personal Web Server is not available on Windows XP Professional. If you upgrade from a Windows home or personal product, you must install IIS for similar Web server functionality.
For more information on IIS, refer to the IIS online documentation by typing http://localhost/iisHelp/ in your browser address bar, and pressing ENTER.

*****Further Links and Reading*****

Installing IIS on Windows XP Pro

Install IIS on Windows XP Professional



IIS Answers

Author Comment

by:Ryan Bennett
ID: 10912720
You're awesome!! Everything that I wanted and needed to know!

LVL 58

Expert Comment

by:Pete Long
ID: 10912839
ooooo we do like a happy customer :)


Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

There are 2 things you must have in order to connect to the internet behind a router, The "Gateway IP" of the router, which is usually something like 192.168.xxx.1, I've seen routers with default values of:,,, …
Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In the video, one can understand the process of resizing images in single or bulk. Kernel Bulk Image Resizer is an easy to use tool for resizing large number of images. One can add and resize multiple images with this tool in single go. The video sh…
Suggested Courses

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question