http handler - redirect to a htm file RRS feed

  • Question

  • User-1877511195 posted
    I'm kind of new to custom http handlers so please excuse me if this is a silly question.

    I have a HTTP handler which works pretty well, i've got a website that appears as static HTML (for search engine purposes) but is in fact dynamically generated from database content.
    The pages appear as .htm extensions but are in fact .aspx pages

    I have another site that i want to apply this technology to, but with a slight twist... I want the user to be able to enter a URL (be it manually or via a link on another page) and the HTTP handler check to see if the page exists, If it doesnt then generate it from database content but if the page does exist then display the static HTML page. Sounds simple enough but i cant seem to get it working...

    I've changed the "App Mappings" so that .htm extensions are handled by the .net dll (aspnet_isapi.dll) I've got the decision making code that checks for the page etc, and ive got a server.transfer command to the page should it exist... oContext.Server.Transfer(sMyURL, True)

    I get an error when this code runs when "sMyURL" is a .htm page the error is "Error executing child request for /MyTest/MyPage.htm."

    I dont really want to have to write code to open the file on disk, read its contents and output it to screen on an .aspx page as the website is a busy site and i think this will put too much extra stress/load on the server...

    Can anyone tell me how to get this server.transfer working or suggest a different approach that would work?
    Wednesday, May 11, 2005 4:12 AM

All replies