0
404に基づいてURLリライトを実行しようとしています。論理が "aspxerrorpath"をチェックしても、常にnullとして表示されます。私のコードは、devサーバー上で完璧に動作します。私はcustomerrorsをオンにしました。また、私のハンドラを指しているIISコントロールパネルにcustomerrorsがあります。なぜそれが404のURLを渡していないのアイデア???aspxerrorpath NULL IIS 6の場合
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('/'));
}
}
}