IIS 7.5 Redirect only one subdirectory

Vinod Vutpala picture Vinod Vutpala · Jan 8, 2013 · Viewed 19.2k times · Source

I have an asp.net application deployed under IIS 7.5 Version with several sub domains under it. I would like to redirect a particaular subdomain to another url.

For example:

www.domain1.com/a
www.domain1.com/b

The above urls should work fine.

www.domain1.com/c

should be redirected to www.domain2.com

How can i achieve this?

Update on my requirement: I have same application deployed for several users (a, b, c) with same application pool. I would like to have redirect for only user c.

Answer

Tanzeel Kazi picture Tanzeel Kazi · Jan 8, 2013
  1. Open the IIS manager. Open the Run dialog (Windows+R), type inetmgr and press Enter. You will need Adminstrator privileges for this.

  2. Select the sub-folder (not virtual folder) within your website in the left pane (by clicking on the folder name) and then open HTTP Redirect in the main view. Sub-folder selection and HTTP Redirect icon

  3. Select Redirect requests to this destination and type in your destination domain name http://www.domain2.com/. Check the other options (if they are applicable to you) and click Apply to save. Setup redirection for sub-folder

  4. Check the redirection in your browser.