简体   繁体   English

/default.aspx找不到

[英]/default.aspx not found

I have an issue which has arisen using Google Page Speed Online although I am worried that there may be a bigger picture to this. 我担心使用Google Page Speed Online时会出现一个问题,尽管我担心这样做的情况可能会更大。 I ran my site through the online tool, see the results here: https://developers.google.com/pagespeed/#url=www.exclaimer.com&mobile=false . 我通过在线工具运行了我的网站,在此处查看结果: https : //developers.google.com/pagespeed/#url=www.exclaimer.com&mobile=false Notice that it claims a redirection as occurred to http://www.exclaimer.com/oops.aspx?aspxerrorpath=/default.aspx 请注意,它声称重定向到http://www.exclaimer.com/oops.aspx?aspxerrorpath=/default.aspx

Now the original URL I plugged in http://www.exclaimer.com and http://www.exclaimer.com/default.aspx both work find in my browser. 现在,我插入http://www.exclaimer.comhttp://www.exclaimer.com/default.aspx的原始URL都可以在浏览器中找到。 I keep a log of any pages which aren't found and indeed /default.aspx is in there over a thousand times (only change has happened 24 hours ago). 我记录了未找到的任何页面的日志,实际上/default.aspx在那里存在超过一千次(仅24小时前发生过更改)。 This wasn't me trying the Page Speed online tool 1000 times so I worry that this may be another Google service (or some other automated system) which is failing. 这不是我尝试1000次Page Speed联机工具的原因,所以我担心这可能是另一个Google服务(或某些其他自动化系统)出现了故障。 There have been no complaints from visitors to the site unable to get access which leads me to believe that for ordinary users there are no problems, the issue only comes from automated bots or similar. 站点访问者没有抱怨无法访问,这使我相信对于普通用户没有问题,问题仅出自自动机器人或类似机器人。

I guess my question is, does anyone know of a way I can isolate the source of the problem? 我想我的问题是,有人知道我可以隔离问题根源的方法吗? I attempted to modify my 404 logging code to capture the page from which /default.aspx was being accessed but not had much luck here as Url Referrer only works under pretty specific conditions. 我试图修改我的404日志记录代码,以捕获从中访问/default.aspx的页面,但是在这里运气不佳,因为Url Referrer仅在相当特定的条件下有效。

Update 更新

I have modified my code to log the error details but nothing is being passed through for /default.aspx. 我已经修改了代码以记录错误详细信息,但/default.aspx没有任何传递。

Exception error = Server.GetLastError();
string errorTitle = "";
string errorDetails = "";
if (error != null)
{
    errorTitle = error.InnerException.Message;
    errorDetails = error.ToString();
}            
Server.ClearError();

... send to database

If the page is redirecting to the error page then there must be an error occuring when that page is being accessed so what you want to do is try to capture what that error is to find what part of your code is causing you problems. 如果页面正在重定向到错误页面,则在访问该页面时必定会发生错误,因此您想要做的就是尝试捕获该错误,以查找代码的哪些部分导致了您的问题。

My guess would be that the problem is that you are assuming a certain http header to be sent from the client and you are not doing a null check on it. 我的猜测是,问题在于您假设要从客户端发送某个HTTP标头,并且您没有对此进行空检查。 When you get a request from a robot which may not be sending accepted languages or something then you get a crash. 当您从可能未发送接受的语言或其他内容的机器人收到请求时,您将崩溃。

In your global error handler you shouldlog whatever exception is getting thrown either in a database or just by dumping it straight to a file. 在您的全局错误处理程序中,您应该记录数据库中抛出的任何异常或直接将异常转储到文件中。 This is useful information at all times and should be captured in the event of any other errors on the site and tracking down their cause. 这始终是有用的信息,如果站点上有任何其他错误并跟踪其原因,则应捕获这些信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM