5

I'm running IIS 7.5 on Windows Server 2008R2.

I currently run a site at the root of mydomain.edu. I also have a variety of applications (e.g., mydomain.edu/calendar, mydomain.edu/research, mydomain.edu/otherapp) running on the server.

I would like to move the root site to a subdirectory (i.e., mydomain.edu/sub) to logically separate the root site's content from the other applications, but have traffic from mydomain.edu point to mydomain.edu/sub.

Is this feasible without displaying 'sub' in the path?

For example, all pages should continue to display mydomain.edu/regularpage.htm or mydomain.edu/directory/page.htm NOT mydomain.edu/sub/regularpage.htm or mydomain.edu/sub/directory/page.htm).

Can exclusions be added so as not to affect the other applications?

I don't know if this is a fairly standard request and I am over-thinking this, or if this is a terrible idea that I absolutely should not consider.

  • Yes to both using URL Rewrite or ISAPI_Rewrite based rules to exclude the paths to your other applications. I'll let someone else answer this in more detail with examples. – dan Jun 27 '14 at 23:13
  • URL rewriting intrigues me, but this description suggests that it may not scale well for a server hosting many other applications. My example listed 3, but how feasible would this be for 30? Is there an inclusive way to do this with URL rewriting rather than an exclusive way? – MTAdmin Jul 2 '14 at 15:19
3

If all you are doing is moving the files on your file system to another location but want to keep the same URL structure, rather than setting up URL Rewrite rules you can change the physical path of your IIS website configuration.

I will make the following assumptions:

  1. You are running website "mydomain.edu" from a physical location such as C:\inetpub\wwwroot.
  2. Your sub applications are running in directories such as C:\inetpub\wwwroot\calendar, C:\inetpub\wwwroot\research, etc.

To change the physical path on the website:

  1. Right click on the website and select 'Manage Web Site...Advanced Settings.'
  2. Change the 'Physical Path' property to 'C:\inetpub\wwwroot\sub' (or the folder name of your choice).
  3. If your other applications are only folders in IIS and are not defined as either virtual directories or applications, you may need to set those up so that the virtual directory points to the appropriate physical path as well. The physical path for the virtual directory can be found in the same way as the website.

Changing the physical path will not have a performance impact. Hope that helps.

  • As simple as that! I see now that IIS 7.5 provides a virtual view of directories under each website rather than a physical view of the disk. Makes sense. Thanks! – MTAdmin Oct 16 '14 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.