[This is preliminary documentation and subject to change]

# Redirecting Requests to a Program

As an advanced use of the redirect method, you can redirect all requests for files in a particular directory to a program. Generally, you also want to pass any parameters from the original URL to the program, which you can do by using redirect variables.

###### To redirect requests to a program

1. In the IIS snap-in, select the Web site or directory and open its property sheets.
2. Click the Home Directory, Virtual Directory, or Directory tab.
3. Select A Redirection to a URL.
4. In the Redirect To text box, type the URL of the program, including any redirect variables needed to pass parameters to the program.

   For example, to redirect all requests for scripts in a Scripts directory to a logging program that records the requested URL and any parameters passed with the URL, type /Scripts/Logger.exe?URL=$V+PARAMS=$P. $V and $P are redirect variables.

5. Select The Exact URL Entered Above to prevent the Web server from appending the original file name to the destination URL.

For more information on redirect variables, see Redirect Reference.

© 1997-2001 Microsoft Corporation. All rights reserved.