URL Rewrite HTTP Module

Hi there,

I have created some URL Rewriting code that I have working perfectly locally under testing.

The code is under my App_Code directory and all compiles fine, I have a line in my web.config called


<httpModules>
<add name="URLRewriter" type="URLRewriter"/>
</httpModules>

This causes my code URLRewriter (My class) to be called everytime there is a request.

However, now that I have uploaded this to my standard jodohost directory it is not doing anything. I dont think that bit of code is even firing ... does anybody have any ideas?
 
When using IIS6, the code in the module is only executed if the requested URL is set to be handled by ASP.NET in IIS. Try requesting something with an .aspx extension and see if your code fires then. With full access to IIS settings, you can change the defaults so pretty much everything gets run through the module, but you don't have that option in a standard shared hosting environment. This behavior is documented fairly widely throughout the net if you want more background info.

In IIS7, .NET is more integrated and you have more options that determine when something is run through your module, but as far as I know, JodoHost uses all Windows 2003 machines, which means IIS6. IIS7 defines HTTP modules in a different config section of the Web.config, by the way: configuration/system.webServer/modules.

PS: MVC stands for Model, View, Controller. Stephen was referring to the ASP.NET MVC Framework :)
 
we'll map mvc for this with a ticket, but we do keep a list as it makes it more vulnerable to DOs attack as well
 
The MVC Framework is one example of this, but yes, it is a common use.
It's good to know anyway, I had started on a MVC website of my own without giving it much thought. Then again, I'm not sure I'll ever finish it :)
 
Hi guys ... thanks for the info.

No we are not using MVC. Only just came across that thanks to the link.

Its using a bit of custom code ... putting .aspx at the end subspace makes no difference unfortunately.
 
Back
Top