asp.netasp.net-mvciisiis-7

"401 Unauthorized" on a directory


I assume this is an IIS error, as this doesn't happen if I run the project on my local machine.

I have my stylesheets at ~/Content/css

Any files in that directory won't load on the page, and when I navigate to them directly, I get a server error:

401 - Unauthorized: Access is denied due to invalid credentials.

You do not have permission to view this directory or page using the credentials that you supplied.

This only happens with that directory, I have no problem accessing any other files. Is there something I need to do in IIS7 to stop this?


Solution

  • It is likely that you do not have the IUSR_computername permission on that folder. I've just had a quick scan and it looks like you will find the information you need here.

    If that isn't the case, are you prompted for your username and password by the browser? If so it may be that IIS is configured to use Integrated authentication only, as described here.