<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>裁纸刀下 &#187; OBLOG</title>
	<atom:link href="http://ofcss.com/tags/oblog/feed" rel="self" type="application/rss+xml" />
	<link>http://ofcss.com</link>
	<description>独立 自由 诚信 宽容 责任 平常心</description>
	<lastBuildDate>Fri, 20 Apr 2012 04:08:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Oblog检测搜索引擎的一个问题</title>
		<link>http://ofcss.com/2008/09/19/bug-about-search-engine-of-oblog.html</link>
		<comments>http://ofcss.com/2008/09/19/bug-about-search-engine-of-oblog.html#comments</comments>
		<pubDate>Fri, 19 Sep 2008 03:10:26 +0000</pubDate>
		<dc:creator>小李刀刀</dc:creator>
				<category><![CDATA[所谓技术]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[OBLOG]]></category>
		<category><![CDATA[博客]]></category>

		<guid isPermaLink="false">http://wukangrui.net/?p=293</guid>
		<description><![CDATA[Oblog采用简称判断搜索引擎。当访问者的计算机名中包含了和某个搜索引起相同的简称就会被当成搜索引擎处理。]]></description>
			<content:encoded><![CDATA[<p>　　今天上班的时候，有一个用户反映博客登陆不了了。</p>
<p>　　因为最近做了整合方面的改动，我第一反应是难道这方面有问题？可是自己测试什么问题都不存在。后来用户抓图来看，是登陆表单的位置一片空白。</p>
<p>　　于是远程协助帮她处理。一般情况下，有人正常有人不正常都会是缓存的问题或者浏览器设置的问题。所以我首先做的也就是这两件事。可是处理之后问题依旧。在用户电脑上打开网页源代码，发现登陆表单是个JS脚本。代码输出正常的。该JS路径在我的电脑上访问就一切正常，而在用户的电脑上则访问不到。测试的时候进一步发现，用户的电脑上似乎只能访问我们博客系统的html静态文件，所以asp文件都返回404错误。<span id="more-293"></span></p>
<p>　　这种问题以前确实没有遇到。只遇到过静态文件可以访问动态脚本不能访问的，那都是IIS的问题，服务器端的问题。于是要从代码下手了。</p>
<p>　　打开login.asp（登陆脚本就是由它输出的），源代码头部首先就看到ChkSpider这个函数。我知道这是检测搜索引擎的，如果发现客户端是搜索引擎，直接截断输出。难道是这个有问题？，首先把这行代码注释了，刷新页面，登陆窗口正常显示了。</p>
<p>　　后来用户又在访问User_Index.asp的时候遇到同样的问题，看来改具体文件不是办法了，打开Class_Sys.asp文件，找到ChkSpider这个函数，进入函数后直接让它Exit Function。再测，问题全都没了。</p>
<p>　　这个问题一般情况下很难遇到，但是实际上几率并不算特别小，只要用户计算机名称包含了google、sohu、sina、soso、baidu、yahoo等字符串（不用严格等同于Spider的名称，只要包含相关字符串），就会被当作是Spider来处理。</p>
<p>　　看来Oblog的这个检测逻辑需要改进一下了。要么，对常用Spider的名称做精确匹配，要么，就换一种方式来检测吧。这个本身并没有问题的代码，跟千奇百怪的计算机名称撞车的可能性还是很大的。</p>
<h3  class="related_post_title">相关日志</h3><ul class="related_post"><li>2005-11-24 -- <a href="http://ofcss.com/2005/11/24/goole-map-creator-for-my-blog.html" title="为我的blog写的Google地图生成器">为我的blog写的Google地图生成器</a></li><li>2005-11-18 -- <a href="http://ofcss.com/2005/11/18/add-trackback-to-pjblog.html" title="用ASP为blog程序编写Trackback功能">用ASP为blog程序编写Trackback功能</a></li><li>2008-06-22 -- <a href="http://ofcss.com/2008/06/22/api-bug-in-powereasy-siteweaver-part2.html" title="动易SW中的一个严重但不影响使用的bug（二）">动易SW中的一个严重但不影响使用的bug（二）</a></li><li>2008-06-18 -- <a href="http://ofcss.com/2008/06/18/api-bug-in-powereasy-siteweaver-part1.html" title="动易SW中的一个严重但不影响使用的bug(一)">动易SW中的一个严重但不影响使用的bug(一)</a></li><li>2008-06-14 -- <a href="http://ofcss.com/2008/06/14/june-15-start-use-new-domain.html" title="615：新域名正式启用">615：新域名正式启用</a></li><li>2008-06-04 -- <a href="http://ofcss.com/2008/06/04/unix-timestamp-in-asp.html" title="在ASP中实现UNIX时间戳">在ASP中实现UNIX时间戳</a></li><li>2008-05-23 -- <a href="http://ofcss.com/2008/05/23/disadvantages-of-discuz-ucenter.html" title="给UCenter的拥蹩们泼点冷水">给UCenter的拥蹩们泼点冷水</a></li><li>2008-04-14 -- <a href="http://ofcss.com/2008/04/14/pjblog-guestbook-plus.html" title="PJBlog自带留言簿增强版改进">PJBlog自带留言簿增强版改进</a></li><li>2005-11-23 -- <a href="http://ofcss.com/2005/11/23/compare-interge-with-string-in-asp.html" title="ASP中的数字和字符比较">ASP中的数字和字符比较</a></li><li>2005-11-14 -- <a href="http://ofcss.com/2005/11/14/build-my-blog-again.html" title="重新做我的blog了">重新做我的blog了</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://ofcss.com/2008/09/19/bug-about-search-engine-of-oblog.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

