Re: .NET code for creating IIS mapping

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Alexander Rudyk (shura_rudyk_at_hotmail.com)
Date: 09/23/04


Date: Thu, 23 Sep 2004 14:15:02 +0300


> <httpHandlers>
> <add path="*.txt" type="System.Web.HttpForbiddenHandler"/>
> </httpHandlers>

This handler works if the user request to some.txt file inside virtual dir
redirected to aspnet_isapi.dll. Only in this case this handler works. But
requests to *.txt files by default dose not redirected to any ISAPI
extension
and thus file content displayed by IE. To redirect requests to txt file to
ASP.NET runtime to I need add IIS mapping "*.txt -> aspnet_isapi.dll"

Main problem how can I do this by program code?

"Girish bharadwaj" <girishb@mvps.org> wrote in message
news:O9W%230dVoEHA.1176@TK2MSFTNGP12.phx.gbl...
> I am not sure I understand. If you want to handle specific extensions
> explicitly, check out the <httpHandlers> documentation for web.config. You
> will need to provide the path and the type. For the example you have
given,
> it might look something to the effect of
> <system.web>
> <httpHandlers>
> <add path="*.txt" type="System.Web.HttpForbiddenHandler"/>
> </httpHandlers>
> ...
> </system.web>
> ..
> in your web.config.
>
> --
> Girish Bharadwaj
> http://msmvps.com/gbvb
> "Alexander Rudyk" <shura_rudyk@hotmail.com> wrote in message
> news:eQ9oMBVoEHA.2824@TK2MSFTNGP10.phx.gbl...
> > Hi all.
> >
> > I need in my MSI custom action create IIS mapping for given virtual
> > directory.
> > For example, assosiate txt file extension with ASP.NET ISAPI to deny
> access
> > to txt file from IE.
> >
> > Maybe someone have example code or links to such code.
> >
> > Thanks
> >
> >
>
>



Relevant Pages

  • Re: Handling dynamic "folders" for url-rewrites?
    ... you can map the 404 handler in IIS to 404.aspx where ... IIS will call the 404.aspx page and append the requested "bogus" url onto the ... known file extension get sent throug ASP.NET, ... requests in global.asax and rewrite the url, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Rederecting DAV requests - on: Apache(2.0)/ mod_perl(2.0)/ perl(5.8)/ webDAV
    ... My mod_perl handler redirects DAV requests. ... Dav client only sees folders, not files, and the folders ... Second step is more tricky, I cant seem to redirect to a sub-path ...
    (comp.lang.perl.modules)
  • Re: IIS question
    ... If Vista 'home' and IIS is a no go then it surely begs the question why is the feature even included in the Windows features to install? ... Requests for assistance by email can not and will not be acknowledged. ... The resource you are looking for does not have a handler associated with it. ... The file extension for the requested URL does not have a handler configured to process the request on the Web server. ...
    (microsoft.public.windows.vista.general)
  • Re: Danger to having Port 80 open on hardware firewall
    ... I was simply replying to the issue of getting http://fqdn/remote to redirect ... > port 80, consider upgrading to ISA. ... > at ISA and never touches the webserver. ... > requests never go any further. ...
    (microsoft.public.windows.server.sbs)
  • Re: Wierd 301 Moved Loop in OWA
    ... appears to be some sort of endless redirect loop. ... The server responds with a 301 ... a non standard port for regular HTTP and then the usual 443 port for ... redirects all requests to HTTPS. ...
    (microsoft.public.exchange.admin)