Search code examples
iissymlinkwwwroot

Access a folder outside of wwwroot with a symlink


I am running a intranet website on IIS. Now my task is to access a folder with a normal href="" outside of the wwwroot folder. I think this isn't possible, so I tried to symlink the folder. I successfully created a symlink to the folder. But now I get the error message: "401 not authorized: Access denied due to invalid notifying informations". Any ideas? All help is highly appreciated! Thanks guys!


Solution

  • First of all don't use symlinks, just add a virtual directory to your site that points to the external folder.

    Once you've done that you then need to ensure that the user the site is running under, usually the "Application Pool Identity" has the correct permissions to access your external folder. One of my previous answers explains how to do this:

    How to apply Application Pool Identity permissions