Thanks Joe,
adding following to web.config really helps.
<system.web>
<httpHandlers>
<add path="*.htm" verb="GET,HEAD"
type="System.Web.StaticFileHandler" validate="True" />
</httpHandlers>
</system.web>
Can you provide more details about drawbacks? Do not want to have some
surpises on production site.
Thanks,
Sergey.
PS: MS is very short in his docs as usual.
Frequently Asked Questions
http://msdn.microsoft.com/asp.net/su...q/default.aspx
Configuring ASP.NET 2.0
I used the ASP.NET configuration system to restrict access to my ASP.NET
application, but anonymous users can still view some of my files. Why is
that?
The features of the ASP.NET configuration system only apply to ASP.NET
resources. For example, Forms Authentication only restricts access to
ASP.NET files, not to static files or ASP (classic) files unless those
resources are mapped to ASP.NET file name extensions. Use the configuration
features of IIS to configure non-ASP.NET resources.
How do we use configuration features of IIS for this purpose? No details.
"Joe Kaplan (MVP - ADSI)" <> wrote
in message news:...
> The standard way to do this is to map the extensions you want served by
> ASP.NET to ASP.NET in the script mappings in IIS (or just use a wildcard
> map). Then, in your web.config file, you map the static file extensions
> to the StaticFileHandler in the httpHandlers config section.
>
> There are some drawbacks to doing this, but it will work for the most
> part.
>
> IIS 7 makes this super easy.
>
> Joe K.
>
> --
> Joe Kaplan-MS MVP Directory Services Programming
> Co-author of "The .NET Developer's Guide to Directory Services
> Programming"
> http://www.directoryprogramming.net
> --
> "Sergey V" <sergey-> wrote in message
> news:uJyo$...
>> Yes,
>>
>> this will work for *.htm files - though we have plenty of them in legacy
>> site. And proper configuration of the site will make much less headache.
>>
>> But what about *.doc and *.xls files? The question is about any resource
>> within protected folders in general.
>>
>> "clickon" <> wrote in message
>> news
C0CF7BD-84C4-423D-A38C-...
>>> Why not just rename the .htm files as .aspx files?
>>>
>>> "Sergey V" wrote:
>>>
>>>> Hi,
>>>>
>>>> I need to cover by custom authentication algorithm both ASP.NET and
>>>> other
>>>> resources within the site.
>>>> FormsAuthentication covers only resources beeing handled by ASP.NET.
>>>> Other
>>>> generic resources can be retrieved without beeing logged on.
>>>>
>>>> I'm trying to configure the site to handle all resources via ASP.NET.
>>>> Is it
>>>> possible?
>>>>
>>>> My results are
>>>>
>>>> a.. Things are working OK under .NET 2.0 Development Server (started
>>>> from
>>>> Visual Studio 2005)
>>>>
>>>>
>>>> b.. Under local WinXP IIS - non-ASP.NET resources (like *.htm,
>>>> *.html) are
>>>> not being authenticated.
>>>>
>>>> Solved by adding ".*" extension mapping to ASP.NET
>>>>
>>>>
>>>> c.. Under WinSrv 2003 SP1 / IIS6 there are following problems
>>>>
>>>> 1.. .* - is not recognized as valid extension
>>>>
>>>> 2.. After mapping .htm to ASP.NET - .htm pages are not served
>>>> anymore.
>>>> a.. Browser shows completely blank page
>>>> b.. HTTP Watch tracks ERROR_HTTP_INVALID_SERVER_RESPONSE error
>>>> code,
>>>> response stream is empty
>>>> c.. IIS log on the server gives error code 200, i.e. OK
>>>> Any ideas to configure this correctly under WinSrv 2003?
>>>>
>>>> Or probably there is some other better way to imlement custom
>>>> authentication
>>>> instead of FormsAuthentication?
>>>>
>>>>
>>>>
>>>> Best regards,
>>>>
>>>> Sergey.
>>>>
>>>>
>>>>
>>
>>
>
>