I have a website that is hosted on my local machine for development. I have a virtual directory named “content” that contains the images for my website (mapped to the physical path “C:\Content” in IIS). The problem is that when a user is not logged into my website, the images don’t show up. I’ve tried putting a web.config file in the content folder using this
<?xml version="1.0"?>
<configuration>
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</configuration>
but that doesn’t work. I’ve also tried adding this to my website’s web.config file
<location path="Content">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
but that’s not working either. Any suggestions?
The
<system.web><authorization>element only refers to content handled by the ASP.NET runtime, not IIS itself (which is<system.webServer>and has a totally different schema). However the Cassini/dev server in VS does use<system.web><authorization>for all resources because ASP.NET handles every request under Cassini.Check your IIS Authentication rules, as well as your NTFS ACLs. Ensure that Anonymous Authentication is enabled and the correct user identity is set. You can do this in IIS Manager.