I'm trying to do a URL rewrite based off a 404. My logic checks for the "aspxerrorpath", but it always shows up as null. My code works perfectly fine on the dev server. I have customerrors turned on. I also have customerrors in the IIS control panel pointing to my handler. Ideas on why it is not passing the 404 url???
public class UrlHandler : Handler301
{
protected override string getRedirectionUri()
{
HttpContext.Current.Response.ContentType = "text/plain";
String request = HttpContext.Current.Request.QueryString["aspxerrorpath"];
if (request != null)
{
SomeUrl url = getUrlLogic();
if (url != null)
{
return url.ReferencedUrl;
}
else
{
return ConfigurationManager.AppSettings["404RedirectionUri"];
}
}
else
{
String site = HttpContext.Current.Request.Url.AbsoluteUri;
return site.Substring(0, site.LastIndexOf('/'));
}
}
}