IIS not serving static pages but serve ASP.NET page

I run into this for the second time and it took quite a bit to resolve it again. The situation is: ISS is serving ASP.NET pages fine but it does not serve static files such as htm. It also does not load images (with plain htm controls not server controls). I ran into this on IIS 7.5 on Windows Server 2008 R2.

I came across a solution which basically says enable static contents in IIS but that did not resolve it for me.
I also looked into MIME type, in IIS, for .htm,.html and .jpg to make sure they were listed as part of static file contents. The problem still existed.
Lastly I also make sure “Network Service” user the permission to the folder. I even enable to full permission, that did not resolve the problem.
At the end I added “everyone” user to the folder and gave it read permission and the pages started serving!

This is weird that you have to give permission to two different users in order to serve ASP.NET pages and plain html pages. I know that Microsoft cares about security but isn’t there a decent solution where you can serve asp and html pages without giving everyone user to the folder. Isn’t that a security risk.

I would like to know a proper solution.

Advertisements
This entry was posted in IIS, Software Development and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s