How do I redirect the url

How do I redirect a url path in IIS?

Taken from Microsoft Technet.

Redirecting Web Sites in IIS 6.0 (IIS 6.0)


When a browser requests a page or a program on your website, the web server looks for the page identified by the URL and returns it to the browser. Whenever you move a page on your website, you can't always fix all of the links pointing to the page's old URL. To ensure that browsers can find the page at the new URL, you can instruct the web server to redirect the browser to the new URL.

You can redirect requests for files in one directory to another directory, to another website, or to another file in another directory. When the browser requests the file at the original URL, the web server instructs the browser to request the page using the new URL.

Important

You must be a member of the Administrators group on the local computer to complete the following procedures. For security reasons, log on to your computer with an account that is not in the Administrators group, and then run the runas command to run IIS Manager as an administrator. At a command prompt, type runas / user: Administrative_AccountName "mmc% systemroot% \ system32 \ inetsrv \ iis.msc".

Procedure

Redirecting requests to another website or directory


  1. In IIS Manager, expand the local computer, right-click the website or directory that you want to redirect, and click Properties.

  2. Click the Home Directory, Virtual Directory, or Directory tab.

  3. Under The content for this source should come from, click A redirect to a URL.

  4. In the Redirect to box, enter the URL of the destination directory or website. For example, to redirect all requests for files in the catalog directory to the NewCatalog directory, type / NewCatalog.

Redirect all requests to a single file


  1. In IIS Manager, expand the local computer, right-click the website or directory that you want to redirect, and click Properties.

  2. Click the Home Directory, Virtual Directory, or Directory tab.

  3. Under The content for this source should come from, click A redirect to a URL.

  4. In the Forward to box, enter the URL of the destination file.

  5. Select the The exact URL entered above check box to prevent the web server from appending the original file name to the destination URL.

    You can use wildcards and redirect variables in the destination URL to control exactly how the original URL is translated to the destination URL.

    You can also use the redirection method to redirect all requests for files in a specific directory to a program. In general, you should pass all parameters from the original URL to the program, which you can do using redirect variables.

    Redirect requests to a program


  6. In IIS Manager, expand the local computer, right-click the website or directory that you want to redirect, and click Properties.

  7. Click the Home Directory, Virtual Directory, or Directory tab.

  8. Under The content for this source should come from, click A redirect to a URL.

    In the Redirect To box, enter the URL of the program, including any redirect variables required to pass parameters to the program. For example, to redirect all requests for scripts in a script directory to a logger that records the requested URL and any parameters passed with the URL, type /Scripts/Logger.exe?URL=$V+PARAMS=$P. $ V and $ P are redirection variables.

  9. Select the The exact URL entered above check box to prevent the web server from appending the original file name to the destination URL.