Urlrewrite using global.aspx
My url is something like this
http://:/cather/getfilters?id=1&desc=xxx
(here id and desc may vary)
i know i can use urlrewrite or handling request in Application_BeginRequest method in global.aspx.
protected void Application_BeginRequest(Object sender, EventArgs e){
try
{
HttpContext myContext = HttpContext.Current;
myContext.RewritePath("actualfile.aspx?" + myContext.Request.QueryString, true);
}
catch (Exception ex) {
}
}
this code is working fine when i tested in my localhost using port number only.
Its not working when i use ipaddress in my local pc or production environment.
I guess only way global.asax file will be called is from the .NET engine which is called by IIS. i think IIS doesn't understand my url
http://:/cather/getfilters?id=1&desc=xxx how to i set up in IIS to make understand above url and calling .NET engine.
so
But strange how its understanding when i use
http://localhost:1987/cather/getfilters?id=1&desc=xxx call is accessing global.aspx and my code working fine.
above
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Lalit MRank #1,186 · 1.5K reputationPosted Dec 5, 2009, 12:07 AM EST
http://forums.asp.net/t/1390671.aspx
http://sanzon.wordpress.com/2008/04/21/url-rewriting-with-globalasax-and-app-mapping/
http://www.codeproject.com/KB/aspnet/ReallyEasyRewriting.aspx