我有这样的自定义错误在我的web.config文件重定向但它似乎并没有工作,因为我加入了redirectMode="ResponseRewrite"
自定义404错误不正确重定向
它工作正常的500错误,但不是404(它只是当我有一个404)
不重定向下面是web.config
<customErrors mode="On" redirectMode="ResponseRewrite">
<error statusCode="404" redirect="/servererror/default.aspx" />
<error statusCode="500" redirect="/servererror/default.aspx" />
</customErrors>
的代码,这是我的servererror/default.aspx
代码
Dim err As System.Exception = Server.GetLastError()
Dim Errormail = New MailMessage
'Send email to Bondholder using email address from form
Errormail.To = "[email protected]"
Errormail.From = "[email protected]"
Errormail.Subject = "Server Error Alert"
Errormail.BodyFormat = MailFormat.Text
Errormail.Priority = MailPriority.Normal
Errormail.Body = ("Error on page - " & err.InnerException.Message & vbcrlf & vbcrlf & "URL of the page - " & Request.Url.ToString())
SmtpMail.SmtpServer = "localhost"
SmtpMail.Send(Errormail)
我需要保持redirectMode="ResponseRewrite"
使得servererror/default.aspx
给我发来电子邮件时有一个错误
任何帮助,将不胜感激
感谢
杰米
UPDATE
我看了一下网页,发现不少其他人有相同的问题,但我找不到明确的答案。
任何想法
感谢
杰米
如果你试图打开nonexistingpage.htm它不应该工作的免费应用程序页面的HTTP状态代码,这是怎么回事,除非如果你使用IPM。 – Tomasi 2010-09-27 14:37:45
什么是IPM?对不起,我是一个新手 – 2010-09-27 15:38:58