I am writing a simple HttpHandler to rewrite a URL, but I am pushing a brick wall.
I created an HttpHandler class that is just simple to check:
public class HttpHandler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.RewritePath("default.aspx", false);
}
public bool IsReusable
{
get
{
return true;
}
}
}
Then I have the following verb in the web.config file:
<httpHandlers>
<add verb="*" path="*" type="Tizma.CMS.Runtime.HttpHandler"/>
</httpHandlers>
Basically, I want the entire incoming URL to go through this rewriter. When I run this, ProcessRequest starts, but RewritePath never gets the default.aspx value.
Please note that this is just a test, and as a result, default.aspx will be transmitted by the query string along the strings? pageid = 2 I just wanted to find out how httphandlers worked.
What am I doing wrong?
source
share