Via web.config we entered this to protect all the files:
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>
That thing works excellent blocking from all directories the anonymous users and allowing access to logged users but just for files like aspx if we try to access a jpg without login it can be accessed. How can make work that script to block all kind of files?
And we added a virtual a directory outside the webapp but the question here is how can we protect everything there also but configuring from webapp not the real directory we don't want to protect from the real directory outside the webapp just we want to protect when the user tries to access via the webapp for example webapp/virualdir/pdf.pdf there protect the pdf if user is not logged.
Our community of experts have been thoroughly vetted for their expertise and industry experience.