为什么我的 ColdFusion 页面向搜索引擎返回空白页面?
我已经完成了大量的 ASP.NET 和 PHP 开发,但我不太熟悉如何在 CF 中跟踪此类事情。我天真的第一个攻击角度是在任何源代码中搜索对 Google 的任何引用。运气不好。
我在 IIS7 上运行该网站。谷歌、必应和雅虎显然都在我的网站上“看不到”任何东西。
更新:我以 Googlebot 身份运行 Fetch 并得到以下信息:
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
Server: Microsoft-IIS/7.0
Set-Cookie: CFID=1638251;expires=Sat, 14-Apr-2040 15:51:41 GMT;path=/
Set-Cookie: CFTOKEN=35688222;expires=Sat, 14-Apr-2040 15:51:41 GMT;path=/
Set-Cookie: LANGUAGEID=1;expires=Sat, 14-Apr-2040 15:51:41 GMT;path=/
Set-Cookie: CFGLOBALS=urltoken%3DCFID%23%3D1638251%26CFTOKEN%23%3D35688222%23lastvisit%3D%7Bts%20%272010%2D04%2D22%2008%3A51%3A41%27%7D%23timecreated%3D%7Bts%20%272010%2D04%2D22%2008%3A51%3A41%27%7D%23hitcount%3D2%23cftoken%3D35688222%23cfid%3D1638251%23;expires=Sat, 14-Apr-2040 15:51:41 GMT;path=/
X-Powered-By: ASP.NET
Date: Thu, 22 Apr 2010 15:51:40 GMT
I've done plenty of ASP.NET and PHP development, but I'm less familiar with how to track this sort of thing down in CF. My naive first angle of attack was to search for any reference to Google in any of the source code. No luck.
I'm running the site on IIS7. Google, Bing and Yahoo all apparently "see" nothing on my site.
Update: I ran Fetch as Googlebot and got the following:
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
Server: Microsoft-IIS/7.0
Set-Cookie: CFID=1638251;expires=Sat, 14-Apr-2040 15:51:41 GMT;path=/
Set-Cookie: CFTOKEN=35688222;expires=Sat, 14-Apr-2040 15:51:41 GMT;path=/
Set-Cookie: LANGUAGEID=1;expires=Sat, 14-Apr-2040 15:51:41 GMT;path=/
Set-Cookie: CFGLOBALS=urltoken%3DCFID%23%3D1638251%26CFTOKEN%23%3D35688222%23lastvisit%3D%7Bts%20%272010%2D04%2D22%2008%3A51%3A41%27%7D%23timecreated%3D%7Bts%20%272010%2D04%2D22%2008%3A51%3A41%27%7D%23hitcount%3D2%23cftoken%3D35688222%23cfid%3D1638251%23;expires=Sat, 14-Apr-2040 15:51:41 GMT;path=/
X-Powered-By: ASP.NET
Date: Thu, 22 Apr 2010 15:51:40 GMT
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 Google 网站管理员工具“Fetch as Googlebot”(在实验室中)可以准确查看您的服务器返回给 Google 的内容。
Use Google Webmaster Tools "Fetch as Googlebot" (its in labs) to see exactly what your server is returning to Google.
结果发现这是一个复杂的 application.cfm 页面。
事实证明,如果没有 cookie,它就无法工作。哦,维护一个生锈的旧网站的乐趣!这不是我所期望的如果禁用 cookie 就会完全失败的网站类型(就内容和总体目的而言)。
作为 CF 的新手,我错误地认为我的简单“example.cfm”只会执行该页面上的代码。我不知道 application.cfm。我检查了包含内容,但什么也没看到。就在那时,我使用 IIS7 的失败请求跟踪功能来搜索跟踪。通过将 googlebot 请求与普通浏览器请求进行比较,我确信在该级别上没有发生任何奇怪的情况。没有加载任何扰乱我的请求的胭脂模块。
It turned out to be a convoluted application.cfm page.
It turns out it didn't work without cookies. Oh the joys of maintaining an old, rusty website! It's not the type of website (in terms of content and overall purpose) I would have expected to completely fail if cookies were disabled.
Being a newbie to CF, I mistakenly assumed that my simple "example.cfm" would only execute code on that page. I wasn't aware of the application.cfm. I checked for includes and saw nothing. That's when I hunted through the trace using IIS7's Failed Request Tracing capability. By comparing the googlebot request with a normal browser request, I became certain that nothing strange was happening at that level. There wasn't any rouge module being loaded that was messing with my request.