HomeFilt - A Filter for Dynamic URL Redirection
HomeFilt demonstrates a way to detect a request for the virtual root of the server and redirect it to another URL. Once the filter is registered in the filter chain, it will be called for each request. This sample examines the URL requested by the client, and if it is just a slash (/), the URL is changed to /sdk/homefilt/home.htm.
The concept behind redirection is quite powerful: you might redirect your entire site to a single HTML file, or you might dynamically redirect requests to other HTML files chosen at random. HomeFilt.C shows that redirection is not complex.
Access the Root of your site to test the filter.
Steps to build the sample:
The build results will be copied to your WWW structure: HomeFilt.Dll will be copied to the SDK sub-directory off the path specified in WWWSCRIPTS, and Default.Htm/Home.Htm will be copied to the HomeFilt sub-directory off the path specified in WWWROOT. The registry entry Filter DLLs is used by IIS to determine what filters to load when the WWW service is starting.
The makefile that comes with the Internet SDK uses the DLL version of the C Runtime Library. You must have this DLL on your server in order for the samples to work. For example, if you are using Visual C++ 4.0 to build the DLL, it will need the debug version of the C Runtime Library DLL, named MSVCR40D.DLL. Verify that this file is in your server's SYSTEM32 directory.