I have a problem with my rewrite working on my live server.
I have the following rewrite rule which works locally for me but I have uploaded the global.asax file with this code in and it returns 404 for this url:
I dont undestand why I get a 404 when the I am using Response.End() within the global file?
If I replace the code within the code snipper field below with the following I still get a 404 for the url above?
bject sender, EventArgs e)
With my little knowledge its as though the url http://aaa.bbb.ccc/Category/Test/
is actually looking for the page http://aaa.bbb.ccc/Category/Test/Default.aspx
which obvously doesnt exist!
Please advise how to resolve this issue so that I can get the Context.RewritePath rule working.
To place the files on the live server I have simply uploaded each default.aspx, default.aspx.cs file together. I have not published the site. Just mentioning that incase it makes a difference.
All other normal pages (i.e. without a rewrite) work fine.
void Application_BeginRequest(object sender, EventArgs e)
string url = "";
url = Request.Path.Substring(0, Request.Path.LastIndexOf("/") + 1);
Match m = Regex.Match(url, "^.*/Category/([^/]*)/?([^/]*)/?$");
if ((m.Success) && (m.Groups.Count == 3))
if (m.Groups.Value != "")
//Context.RewritePath("/Category/Default.aspx?name=" + m.Groups.Value);