Should I put my ASP.NET websites in the wwwroot folder?
Solution 1
Go the second route.
wwwroot is simply there as the container for the default website for the server. If you delete the default website from within IIS, then you can safely remove this directory. Regardless, your sites have nothing to do with the default, so they should be in their own folders under inetpub.
That said, we sometimes have multiple "types" of sites on the same server. For example DEV and QA. In this case I would structure it as:
c:\inetpub\dev\site1
c:\inetpub\dev\site2
c:\inetpub\qa\site1
c:\inetpub\qa\site2
Solution 2
As variant:
C:\WebSites\my.site1.com
C:\WebSites\my.site2.com
Jonathan Williams
Certified SDL Web (Tridion) Architect and Developer with over fifteen years of SDL Tridion experience on 40+ implementations. SDL Tridion MVP (2014 onwards) Co-founder at UK based, SDL Tridion Partner Stage Two (UK) Ltd. (https://wearestagetwo.com). Website: https://wearestagetwo.com Blog: http://wearestagetwo.com/blog Twitter: https://twitter.com/wearestagetwo Twitter (personal): https://twitter.com/_JWilliams LinkedIn: https://www.linkedin.com/in/jonathan-andrew-williams
Updated on September 24, 2020Comments
-
Jonathan Williams over 3 years
I have a number of websites that run under IIS on a single machine.
Should I put these websites inside of the C:\inetpub\wwwroot\ folder or inside the C:\inetpub\ folder?
E.g.
- C:\inetpub\wwwroot\Website1\
- C:\inetpub\wwwroot\Website2\
or
- C:\inetpub\Website1\
- C:\inetpub\Website2\
Are there any pros/cons for either or another recommended location (I only have a C drive on this machine)?
I am not sure whether there is a "correct" answer to this, but want to follow best practice if there is one.
Many thanks, Jonathan
-
Jonathan Williams over 12 yearsThanks Chris. Yes, I suspected that this was the case. I have created my website folders inside of the inetpub folder.
-
simbolo almost 9 yearsThe
wwwroot
folder is the default website that contains the IIS welcome homepage. Anything you place into this, will be accessible if you visit the server via it's IP address, or a binding the server doesn't recognise. Placing websites here is not recommended, place your website directory alongside this root folder, not inside it. -
DJIDave over 7 yearsI would stay away from this option as the desktop is linked to a single user (the folder tends to be under user settings on the machine) so removal of that user would break your website. I do understand the point of the post is "You can put it anywhere" but this is a bad exampl
-
mchar almost 4 yearsMake sure to assign the proper permissions to any new created directory, as those assigned to the wwwroot before deleting it.