views:

155

answers:

4

IS this possible? Basically, I want to point both sites to the same folder in IIS. If this is possible what are the dangers.

Daniel

+1  A: 

Yes, we do it quite a bit. We haven't had any problem with doing it that I know of. I could see problems if both sites are writing to the directory (like the same file), but other than that you should be good to go.

Kevin
+2  A: 

Yes, just set point both sites to the same folder in IIS when you create the sites.

hopethisworks
A: 

Define "site".

If you create a website in IIS you can assign multiple host headers to that site so that, for example, visitors to www.thissite.com and www.thatsite.com will both arrive at the same collection of pages and code - this is trivial and, providing that the site itself doesn't include and explicit URL references to its pages its will more or less "just work".

Given that that bit is straightforward to answer the question properly requires a bit more detail about what you're trying to achieve.

Murph
A: 

If you are running multiple sites and want to SHARE some parts of the sites among them, then place the parts in "seperate areas" outside the sites folder structures.

Then you open your IIS management console and add a "virtual folder" under each site. This virtual folder can be anywhere on your webserver, including a folder they both can read and write too.

The name of the virtual folder will be seen as a normal "folder" inside your website.

Let's assume you make an "admin" or "library" folder and want to reuse this. Then just create virtual folder, name it eg. "library" and then point the folder to where this library is located. Btw. you can setup seperate application rules for a virtual folder eg. mime types, restrictions on what to run etc.

We use this approach for our CMS where we have each customer in seperate folders, but the administration part is the same. So we only have to update the administrative code once place.

You'll requiere to have access to the metadatabase of your IIS though either through IIS Management console or through administrative scripts.

BerggreenDK