Last post Jul 25, 2007 05:57 AM by naturehermit
Jul 22, 2007 04:52 PM|MikeHunt|LINK
I was just wondering if there is a prefered method for remapping urls (httpmodule vs httphandler), and why? I know I can use both methods, but which is more efficient? I want intercept the request, and redirect the user to the appropriate content page based
on some business rules.
Jul 23, 2007 03:12 AM|somnathmali|LINK
if you are using the ASP.NET 2.0 ..then try to use URL mapping.
If you want to use your own code then HTTPModule is the answer.
use URLChecking httpmodules. For more info serach on that.
Jul 23, 2007 06:40 AM|MikeHunt|LINK
Thanks, but what I was really asking is why someone might choose a httpmodule vs. a httphandler when creating a url rewrite engine.
Jul 25, 2007 12:24 AM|Rex Lin - MSFT|LINK
Here is the better blog here to discuss the difference between the two approaches:
Url Rewriting using IHttpModule vs ISAPI Rewrite
If i misunderstand you about your question, please feel free to correct me and i will try to help you with more information.
I hope the above information will be helpful. If you have any issues or concerns, please let me know. It's my pleasure to be
Jul 25, 2007 05:57 AM|naturehermit|LINK
All good however httphandlers stand favorites because they plug in the request cycle, as pointed by above posts. however HttpModules are designed to participate in the processing of a request, HttpHandlers are designed to be the endpoint for the processing
of a request.
An HttpHandler provides a way to define new page processors that handle new types of programming models.
Built in ASP.NET HttpHandlers
Processes .aspx pages.
Processes .asmx XML Web services.
Yields an error message indicating that a type of page is not in service. By default all .asax, .vb, .cs, .ascx, .config, .csproj, .vbproj, .webinfo files are mapped to this in machine.config.
Delivers any page that isn't specifically mapped, such as .html, .htm, and .jpg.
Shows the page containing all of the trace output.
However just to let you guys also know that this kind or URL re-writes now have been establish to fiddle with SEO work and it has been established. Even the community server is prone to this bug, well did I say bug...well its the way its written and the
way search engines treat it as illegitimate.