<?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>樂思蜀SEO博客 &#187; 技术文章整理</title>
	<atom:link href="http://www.lesishu.com/category/articles/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lesishu.com</link>
	<description>樂思蜀的博客，包括但不限于SEO&#38;SEM研究、应用中的心得体会，互联网、搜索引擎观察与思考。</description>
	<lastBuildDate>Fri, 09 Jul 2010 17:11:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<atom:link rel='hub' href='http://www.lesishu.com/?pushpress=hub'/>
		<item>
		<title>国外主机 406 Not Acceptable 的解决方法</title>
		<link>http://www.lesishu.com/articles/406-not-acceptable/</link>
		<comments>http://www.lesishu.com/articles/406-not-acceptable/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 15:37:19 +0000</pubDate>
		<dc:creator>樂思蜀</dc:creator>
				<category><![CDATA[技术文章整理]]></category>
		<category><![CDATA[Justhost]]></category>
		<category><![CDATA[主机]]></category>
		<category><![CDATA[国外主机]]></category>

		<guid isPermaLink="false">http://www.lesishu.cn/?p=1115</guid>
		<description><![CDATA[前几天推荐了 Justhost主机，今天发现了一个问题并成功解决，现将方法分享给大家。经观察，可能出现 406错误的不只Justhost，所以统称国外主机解决方法，没有出现过 406错误的主机忽略本文。 故障现象：访问网站某些功能时，出现“406 Not Acceptable”错误（如樂思蜀在SEO论坛中查看某用户的资料，或操作用户信息时）。 故障原因：Justhost主机默认开启了Mod security，增加网站安全性。当用户访问的URL中包含“%”等敏感字符，就会被Mod security拦截掉，所以会出现406错误。 说明： 首先，Justhost 现在使用的是新版本的 Mod security，在网上搜索到其他文章资料中介绍的使用.htaccess控制 Mod security 选项的方法已经不能使用了，大家不必去尝试。 其次，使用下面方法，Justhost 技术人员会为你关掉 Mod security，就意味着网站将没有 Mod security 的保护，所以具有很高安全要求的网站应三思。 解决方法： 现在使用.htaccess文件不能控制了，老樂尝试联系 Live Chat，告知他们解决不了，需要发邮件，或登录帐户提交Ticket。 发一封邮件到：support@justhost.com，内容大致如下（将红色部分和蓝色部分替换为你的域名和Justhost帐户名）： Hello, I am sorry to bother you! I hope you can help me disable the Mod security for this domain: ???.com, my cpanel account name [...]]]></description>
			<content:encoded><![CDATA[<p>前几天推荐了 <a href="http://www.lesishu.com/net/affiliates-justhost/" target="_blank">Justhost主机</a>，今天发现了一个问题并成功解决，现将方法分享给大家。经观察，可能出现 406错误的不只Justhost，所以统称国外主机解决方法，没有出现过 406错误的主机忽略本文。</p>
<p><strong>故障现象</strong>：访问网站某些功能时，出现“<a href="http://www.lesishu.com/articles/406-not-acceptable/">406 Not Acceptable</a>”错误（如<a href="http://www.lesishu.com/">樂思蜀</a>在<a href="http://www.seobbs.net/">SEO论坛</a>中查看某用户的资料，或操作用户信息时）。</p>
<p><strong>故障原因</strong>：Justhost主机默认开启了Mod security，增加网站安全性。当用户访问的URL中包含“%”等敏感字符，就会被Mod security拦截掉，所以会出现406错误。</p>
<p><strong>说明</strong>：</p>
<p>首先，Justhost 现在使用的是新版本的 Mod security，在网上搜索到其他文章资料中介绍的使用.htaccess控制 Mod security 选项的方法已经不能使用了，大家不必去尝试。</p>
<p>其次，使用下面方法，Justhost 技术人员会为你关掉 Mod security，就意味着网站将没有 Mod security 的保护，所以具有很高安全要求的网站应三思。</p>
<p><strong>解决方法</strong>：</p>
<p>现在使用.htaccess文件不能控制了，老樂尝试联系 Live Chat，告知他们解决不了，需要发邮件，或登录帐户提交Ticket。</p>
<p>发一封邮件到：support@justhost.com，内容大致如下（将红色部分和蓝色部分替换为你的域名和Justhost帐户名）：</p>
<blockquote><p>Hello, I am sorry to bother you! I hope you can help me disable the Mod security for this domain: <strong><span style="color: #ff0000;">???.com</span></strong>, my cpanel account name is <strong><span style="color: #0000ff;">???</span></strong>. Because my URL must contain the characters "%", but the Mod security led to the error, thanks very much!</p></blockquote>
<p>一般30分钟之内，会收到技术人员的邮件，告知已经 disabled mod_security；并要求回复邮件，反馈一下情况，网站是否完全工作正常。</p>
<p>再访问网站，会发现 406错误已经解决；回复一下 Support吧，Everything is OK，再Thanks一下 <img src='http://www.lesishu.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /><br />
<h2>相关文章</h2>
<ul class="related_post">
<li><a href="http://www.lesishu.com/net/affiliates-justhost/" title="国外主机推荐：Justhost">国外主机推荐：Justhost</a></li>
<li><a href="http://www.lesishu.com/i-say/dreamhost-promo-code/" title="Dreamhost优惠码">Dreamhost优惠码</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.lesishu.com/articles/406-not-acceptable/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>IIS Rewrite 下载与配置</title>
		<link>http://www.lesishu.com/articles/iis-rewrite/</link>
		<comments>http://www.lesishu.com/articles/iis-rewrite/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 09:45:34 +0000</pubDate>
		<dc:creator>樂思蜀</dc:creator>
				<category><![CDATA[技术文章整理]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[Rewrite]]></category>

		<guid isPermaLink="false">http://www.lesishu.cn/?p=952</guid>
		<description><![CDATA[Apache 下启用与设置 Rewrite 是很简单的事，也很灵活；但IIS下Rewrite需要添加组件，通过筛选器的方式实现，下面是组件下载与配置方法。 IIS Rewrite 下载 点击这里下载 IIS Rewrite 组件 IIS Rewrite 配置 1、将下载的 IIS Rewrite 组件解压，放到适当的目录（如 C:Rewrite）下。 2、在“IIS管理器”里选择网站，右键，属性。 3、选择“ISAPI”，点击“添加”。 4、填入筛选器名称，如“rewrite”。 5、可执行文件下方点击“浏览”，选择刚才解压的Rewrite组件位置，Rewrite.dll。 6、确认选择正确后，点击“确定”。 7、点击“确定”，完成筛选器添加。 8、重启IIS。 9、重启IIS后，再次选择站点，右键，属性，看到如下所示向上的绿箭头，说明 IIS Rewrite 成功添加并运行。 IIS Rewrite 规则设置 解压后的 IIS Rewrite 组件目录（如 C:Rewrite）中，有一个 httpd.ini 文件，将相应规则写入到这个文件中即可。 安装方法压缩包中 Readme.txt 也有说明。 相关文章 ECSHOP Rewrite 规则 For ASP.Net URLRewriter]]></description>
			<content:encoded><![CDATA[<p>Apache 下启用与设置 Rewrite 是很简单的事，也很灵活；但IIS下Rewrite需要添加组件，通过筛选器的方式实现，下面是组件下载与配置方法。</p>
<p><strong>IIS Rewrite 下载</strong></p>
<p><a href="http://www.lesishu.com/wp-content/uploads/rewrite.zip" target="_blank">点击这里下载 IIS Rewrite 组件</a></p>
<p><strong>IIS Rewrite 配置</strong></p>
<p>1、将下载的 IIS Rewrite 组件解压，放到适当的目录（如 C:Rewrite）下。</p>
<p><img class="alignnone size-full wp-image-954" title="IIS Rewrite" src="http://www.lesishu.com/wp-content/uploads/iis-rewrite-1.gif" alt="IIS Rewrite" width="423" height="170" /></p>
<p>2、在“IIS管理器”里选择网站，右键，属性。</p>
<p><img class="alignnone size-full wp-image-955" title="IIS Rewrite" src="http://www.lesishu.com/wp-content/uploads/iis-rewrite-2.gif" alt="IIS Rewrite" width="361" height="534" /></p>
<p>3、选择“ISAPI”，点击“添加”。</p>
<p><img class="alignnone size-full wp-image-956" title="IIS Rewrite" src="http://www.lesishu.com/wp-content/uploads/iis-rewrite-3.gif" alt="IIS Rewrite" width="471" height="452" /></p>
<p>4、填入筛选器名称，如“rewrite”。</p>
<p><img class="alignnone size-full wp-image-957" title="IIS Rewrite" src="http://www.lesishu.com/wp-content/uploads/iis-rewrite-4.gif" alt="IIS Rewrite" width="471" height="452" /></p>
<p>5、可执行文件下方点击“浏览”，选择刚才解压的Rewrite组件位置，Rewrite.dll。</p>
<p><img class="alignnone size-full wp-image-958" title="IIS Rewrite" src="http://www.lesishu.com/wp-content/uploads/iis-rewrite-5.gif" alt="IIS Rewrite" width="594" height="470" /></p>
<p>6、确认选择正确后，点击“确定”。</p>
<p><img class="alignnone size-full wp-image-959" title="IIS Rewrite" src="http://www.lesishu.com/wp-content/uploads/iis-rewrite-6.gif" alt="IIS Rewrite" width="471" height="451" /></p>
<p>7、点击“确定”，完成筛选器添加。</p>
<p><img class="alignnone size-full wp-image-960" title="IIS Rewrite" src="http://www.lesishu.com/wp-content/uploads/iis-rewrite-7.gif" alt="IIS Rewrite" width="472" height="452" /></p>
<p>8、重启IIS。</p>
<p><img class="alignnone size-full wp-image-962" title="IIS Rewrite" src="http://www.lesishu.com/wp-content/uploads/iis-rewrite-8.gif" alt="IIS Rewrite" width="470" height="351" /></p>
<p><img class="alignnone size-full wp-image-961" title="IIS Rewrite" src="http://www.lesishu.com/wp-content/uploads/iis-rewrite-9.gif" alt="IIS Rewrite" width="371" height="248" /></p>
<p>9、重启IIS后，再次选择站点，右键，属性，看到如下所示向上的绿箭头，说明 IIS Rewrite 成功添加并运行。</p>
<p><img class="alignnone size-full wp-image-963" title="IIS Rewrite" src="http://www.lesishu.com/wp-content/uploads/iis-rewrite-10.gif" alt="IIS Rewrite" width="470" height="452" /></p>
<p><strong>IIS Rewrite 规则设置</strong></p>
<p>解压后的 IIS Rewrite 组件目录（如 C:Rewrite）中，有一个 httpd.ini 文件，将相应规则写入到这个文件中即可。</p>
<p>安装方法压缩包中 Readme.txt 也有说明。<br />
<h2>相关文章</h2>
<ul class="related_post">
<li><a href="http://www.lesishu.com/script/ecshop-url-rewriting-in-asp-net/" title="ECSHOP Rewrite 规则 For ASP.Net URLRewriter">ECSHOP Rewrite 规则 For ASP.Net URLRewriter</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.lesishu.com/articles/iis-rewrite/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>尼尔森F形状网页浏览模式</title>
		<link>http://www.lesishu.com/articles/f-reading-pattern-eyetracking/</link>
		<comments>http://www.lesishu.com/articles/f-reading-pattern-eyetracking/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 12:42:29 +0000</pubDate>
		<dc:creator>樂思蜀</dc:creator>
				<category><![CDATA[技术文章整理]]></category>

		<guid isPermaLink="false">http://www.lesishu.cn/?p=203</guid>
		<description><![CDATA[今天，樂思蜀给大家分享一项有点老的、但非常经典的研究。 2006年4月，美国长期研究网站可用性的著名网站设计师杰柯柏·尼尔森（Jakob Nielsen）发表了一项《眼球轨迹的研究》报告（原文：F-Shaped Pattern For Reading Web Content）。 报告中提出，大多数情况下浏览者都不由自主的以“Ｆ”形状的模式阅读网页，这种基本恒定的阅读习惯决定了网页呈现F形的关注热度（见附图）。 F形状网页浏览模式的形成 研究表明，浏览者打开网页后，按照下面的习惯形成F形网页浏览模式： 第一步：水平移动 浏览者首先在网页最上部形成一个水平浏览轨迹。 第二步：目光下移，短范围水平移动 浏览者会将目光向下移，扫描比上一步短的区域。 第三步：垂直浏览 浏览者完成上两步后，会将目光沿网页左侧垂直扫描；这一步的浏览速度较慢，也较有系统性、条理性。 附图：F形状网页浏览模式 下面为杰柯柏·尼尔森报告中的3张热度图，用颜色来表示浏览者眼光聚集的热度，分为最热（红色）、较热（黄色）、不热（蓝色）和基本不关注（灰色）4种。其中图3搜索结果页因SERP中网站标题、网页摘要较宽，第二条线会随之加长，但仍然是F形状。 图1 一般说明性网页 图2 电子商务网页 图3 Google搜索结果页 路过的还看了]]></description>
			<content:encoded><![CDATA[<p>今天，<a href="http://www.lesishu.com">樂思蜀</a>给大家分享一项有点老的、但非常经典的研究。</p>
<p><img class="alignleft" style="float: left;" src="http://www.lesishu.com/wp-content/uploads/jakob-nielsen.jpg" alt="Jakob Nielsen" />2006年4月，美国长期研究网站可用性的著名网站设计师<a href="http://www.useit.com/jakob/" target="_blank">杰柯柏·尼尔森</a>（Jakob Nielsen）发表了一项《眼球轨迹的研究》报告（原文：<a href="http://www.useit.com/alertbox/reading_pattern.html" target="_blank">F-Shaped Pattern For Reading Web Content</a>）。</p>
<p>报告中提出，大多数情况下浏览者都不由自主的以“Ｆ”形状的模式阅读网页，这种基本恒定的阅读习惯决定了网页呈现F形的关注热度（见附图）。</p>
<p><strong>F形状网页浏览模式的形成</strong></p>
<p>研究表明，浏览者打开网页后，按照下面的习惯形成F形网页浏览模式：</p>
<p><img src="http://www.lesishu.com/wp-content/uploads/f.gif" alt="F形状浏览模式形成" width="400" height="285" /></p>
<p><strong>第一步</strong>：水平移动</p>
<p>浏览者首先在网页最上部形成一个水平浏览轨迹。</p>
<p><strong>第二步</strong>：目光下移，短范围水平移动</p>
<p>浏览者会将目光向下移，扫描比上一步短的区域。</p>
<p><strong>第三步</strong>：垂直浏览</p>
<p>浏览者完成上两步后，会将目光沿网页左侧垂直扫描；这一步的浏览速度较慢，也较有系统性、条理性。</p>
<p><strong>附图：<a href="http://www.lesishu.com/articles/f-reading-pattern-eyetracking/">F形状网页浏览模式</a></strong></p>
<p>下面为杰柯柏·尼尔森报告中的3张热度图，用颜色来表示浏览者眼光聚集的热度，分为最热（<span style="color: #ff0000;">红色</span>）、较热（<span style="color: #ffff00;">黄色</span>）、不热（<span style="color: #0000ff;">蓝色</span>）和基本不关注（<span style="color: #c0c0c0;">灰色</span>）4种。其中图3搜索结果页因SERP中网站标题、<a href="http://www.lesishu.com/tag/%e9%a1%b5%e9%9d%a2%e6%91%98%e8%a6%81/">网页摘要</a>较宽，第二条线会随之加长，但仍然是F形状。</p>
<p><img src="http://www.lesishu.com/wp-content/uploads/f-reading-pattern-eyetracking-1.jpg" alt="F形状网页浏览模式：一般说明性网页" width="280" height="349" /></p>
<p>图1 一般说明性网页</p>
<p><img src="http://www.lesishu.com/wp-content/uploads/f-reading-pattern-eyetracking-2.jpg" alt="F形状网页浏览模式：电子商务网页" /></p>
<p>图2 电子商务网页</p>
<p><img src="http://www.lesishu.com/wp-content/uploads/f-reading-pattern-eyetracking-3.jpg" alt="F形状网页浏览模式：Google搜索结果页" /></p>
<p>图3 Google搜索结果页<br />
<h2>路过的还看了</h2>
<ul class="related_post"></ul>
]]></content:encoded>
			<wfw:commentRss>http://www.lesishu.com/articles/f-reading-pattern-eyetracking/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>WordPress博客robots.txt写法</title>
		<link>http://www.lesishu.com/articles/wordpress-robots/</link>
		<comments>http://www.lesishu.com/articles/wordpress-robots/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 06:23:02 +0000</pubDate>
		<dc:creator>樂思蜀</dc:creator>
				<category><![CDATA[技术文章整理]]></category>
		<category><![CDATA[Robots]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.lesishu.cn/?p=154</guid>
		<description><![CDATA[使用WordPress搭建的博客，利用robots.txt文件限制搜索引擎抓取部分目录及文件，归纳大致有以下几种方法。 最简单的开放写法 不作任何限制，WordPress站内链接结构比较合理，作为一般博客，完全开放就可以了，代码： User-agent: * Disallow: 允许所有蜘蛛访问，允许访问所有内容。WordPress只要模板中链接设计合理，没有需要限制的特殊内容，推荐使用这种写法。 最简单的严格写法 User-agent: * Disallow: /wp-* #Allow: /wp-content/uploads/ Disallow: /*.php$ Disallow: /*.inc$ Disallow: /*.js$ Disallow: /*.css$ Disallow: /?s= 允许所有蜘蛛访问，限制以“wp-”开头的目录及文件，限制抓取.php文件、.inc文件、.js文件、.css文件，限制抓取搜索结果。 Disallow: /wp-* 会连同附件目录一起限制抓取，如果想让搜索引擎抓取附件中的内容，将第三行的 # 号注释去掉。Allow 不是所有搜索引擎都支持。 最合理的写法 卖瓜的都说自己瓜甜，我也觉得自己的Robots.txt写的最合理 User-agent: * Disallow: /wp-admin Disallow: /wp-content/plugins Disallow: /wp-content/themes Disallow: /wp-includes Disallow: /?s= Sitemap: http://www.lesishu.com/sitemap.xml 允许所有搜索引擎抓取，逐一列举需要限制的目录，限制抓取搜索结果。 包含sitemap.xml地址（这一项viki中有专门的说明，但Google管理员工具会提示‘检测到无效的 Sitemap 引用’，有效性尚有争议）。 robots.txt其他写法 为避免在搜索引擎中出现重复页面，WordPress玩家自创了很多robots写法，列举一些常用的，作为参考（适用于伪静态方式的永久链接）： Disallow: /page/ [...]]]></description>
			<content:encoded><![CDATA[<p>使用WordPress搭建的博客，利用robots.txt文件限制搜索引擎抓取部分目录及文件，归纳大致有以下几种方法。</p>
<p><strong>最简单的开放写法</strong></p>
<p>不作任何限制，WordPress站内链接结构比较合理，作为一般博客，完全开放就可以了，代码：</p>
<blockquote><p>User-agent: *<br />
Disallow:</p></blockquote>
<p>允许所有蜘蛛访问，允许访问所有内容。WordPress只要模板中链接设计合理，没有需要限制的特殊内容，推荐使用这种写法。</p>
<p><strong>最简单的严格写法</strong></p>
<blockquote><p>User-agent: *<br />
Disallow: /wp-*<br />
#Allow: /wp-content/uploads/<br />
Disallow: /*.php$<br />
Disallow: /*.inc$<br />
Disallow: /*.js$<br />
Disallow: /*.css$<br />
Disallow: /?s=</p></blockquote>
<p>允许所有蜘蛛访问，限制以“wp-”开头的目录及文件，限制抓取.php文件、.inc文件、.js文件、.css文件，限制抓取搜索结果。</p>
<p>Disallow: /wp-* 会连同附件目录一起限制抓取，如果想让搜索引擎抓取附件中的内容，将第三行的 # 号注释去掉。Allow 不是所有搜索引擎都支持。</p>
<p><strong>最合理的写法</strong></p>
<p>卖瓜的都说自己瓜甜，我也觉得自己的Robots.txt写的最合理 <img src='http://www.lesishu.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<blockquote><p>User-agent: *<br />
Disallow: /wp-admin<br />
Disallow: /wp-content/plugins<br />
Disallow: /wp-content/themes<br />
Disallow: /wp-includes<br />
Disallow: /?s=<br />
Sitemap: http://www.lesishu.com/sitemap.xml</p></blockquote>
<p>允许所有搜索引擎抓取，逐一列举需要限制的目录，限制抓取搜索结果。</p>
<p>包含sitemap.xml地址（这一项<a href="http://en.wikipedia.org/wiki/Robots.txt" target="_blank">viki</a>中有专门的说明，但Google管理员工具会提示‘检测到无效的 Sitemap 引用’，有效性尚有争议）。</p>
<p><strong>robots.txt其他写法</strong></p>
<p>为避免在搜索引擎中出现重复页面，WordPress玩家自创了很多robots写法，列举一些常用的，作为参考（适用于伪静态方式的永久链接）：</p>
<p>Disallow: /page/</p>
<p>#限制抓取WordPress分页</p>
<p>Disallow: /category/*/page/*</p>
<p>#限制抓取分类的分页</p>
<p>Disallow: /tag/</p>
<p>#限制抓取标签页面</p>
<p>Disallow: */trackback/</p>
<p>#限制抓取Trackback内容</p>
<p>Disallow: /category/*</p>
<p>#限制抓取所有分类列表</p>
<p>最后，推荐使用 <a href="https://www.google.com/webmasters/tools/" target="_blank">Google管理员工具</a>，登录后访问“工具 -&gt; 分析 robots.txt”，检查文件有效性。<br />
<h2>相关文章</h2>
<ul class="related_post">
<li><a href="http://www.lesishu.com/script/wordpress-find-and-replacer/" title="WordPress内容批量替换插件：Find and Replacer">WordPress内容批量替换插件：Find and Replacer</a></li>
<li><a href="http://www.lesishu.com/script/wordpress-category-rss-and-1-plugin/" title="WordPress分类RSS &#038; 插件1个">WordPress分类RSS &#038; 插件1个</a></li>
<li><a href="http://www.lesishu.com/script/wordpress-revision/" title="关闭WordPress修订功能，清除“Revision”的方法">关闭WordPress修订功能，清除“Revision”的方法</a></li>
<li><a href="http://www.lesishu.com/i-say/wordpress-gravatar/" title="WordPress 评论头像设置方法">WordPress 评论头像设置方法</a></li>
<li><a href="http://www.lesishu.com/share/wordpress-writter-ping-xml-date/" title="解决WordPress使用Zoundry等博客写作工具的小问题">解决WordPress使用Zoundry等博客写作工具的小问题</a></li>
<li><a href="http://www.lesishu.com/script/wordpress-theme-seo-adsense/" title="WordPress模板（SEO+Adsense）">WordPress模板（SEO+Adsense）</a></li>
<li><a href="http://www.lesishu.com/i-say/my-blog-wordpress-theme/" title="樂思蜀博客模板、设置等说明">樂思蜀博客模板、设置等说明</a></li>
<li><a href="http://www.lesishu.com/script/wordpress-262/" title="WordPress 2.6.2 发布">WordPress 2.6.2 发布</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.lesishu.com/articles/wordpress-robots/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>301转向代码合集</title>
		<link>http://www.lesishu.com/articles/301/</link>
		<comments>http://www.lesishu.com/articles/301/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 11:12:52 +0000</pubDate>
		<dc:creator>樂思蜀</dc:creator>
				<category><![CDATA[技术文章整理]]></category>
		<category><![CDATA[SEO资源]]></category>

		<guid isPermaLink="false">http://www.lesishu.cn/articles/301/</guid>
		<description><![CDATA[樂思蜀将SEO工作中所需要的301转向代码进行了整理，收藏并分享，以备查阅。 1、IIS下301设置 Internet信息服务管理器 -&#62; 虚拟目录 -&#62; 重定向到URL，输入需要转向的目标URL，并选择“资源的永久重定向”。 2、ASP下的301转向代码 &#60;%@ Language=VBScript %&#62; &#60;% Response.Status="301 Moved Permanently" Response.AddHeader "Location", "http://www.lesishu.com/articles/301/" %&#62; 3、ASP.Net下的301转向代码 &#60;script runat="server"&#62; private void Page_Load(object sender, System.EventArgs e) { Response.Status = "301 Moved Permanently"; Response.AddHeader("Location","http://www.lesishu.com/articles/301/"); } &#60;/script&#62; 4、PHP下的301转向代码 header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.lesishu.com/articles/301/"); exit(); 5、CGI Perl下的301转向代码 $q = new CGI; print $q-&#62;redirect("http://www.new-url.com/");  6、JSP下的301转向代码 &#60;% [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.lesishu.com/">樂思蜀</a>将SEO工作中所需要的<a href="http://www.lesishu.com/articles/301/">301转向</a>代码进行了整理，收藏并分享，以备查阅。</p>
<p><strong>1、IIS下301设置</strong></p>
<p>Internet信息服务管理器 -&gt; 虚拟目录 -&gt; 重定向到URL，输入需要转向的目标URL，并选择“资源的永久重定向”。</p>
<p><strong>2、ASP下的301转向代码</strong></p>
<blockquote><p>&lt;%@ Language=VBScript %&gt;<br />
&lt;%<br />
Response.Status="301 Moved Permanently"<br />
Response.AddHeader "Location", "http://www.lesishu.com/articles/301/"<br />
%&gt;</p></blockquote>
<p><strong>3、ASP.Net下的301转向代码</strong></p>
<blockquote><p><span style="font-family: Courier New;">&lt;script runat="server"&gt;<br />
private void Page_Load(object sender, System.EventArgs e)<br />
{<br />
Response.Status = "301 Moved Permanently";<br />
Response.AddHeader("Location","<span style="font-family: Georgia;">http://www.lesishu.com/articles/301/</span>");<br />
}<br />
&lt;/script&gt;</span></p></blockquote>
<p><span style="font-family: Courier New;"><strong>4、PHP下的301转向代码</strong></span></p>
<blockquote><p>header("HTTP/1.1 301 Moved Permanently");<br />
header("Location: http://www.lesishu.com/articles/301/");<br />
exit();</p></blockquote>
<p><strong>5、CGI Perl下的301转向代码</strong></p>
<blockquote><p><span style="font-family: Verdana;">$q = new CGI;<br />
print $q-&gt;redirect("http://www.new-url.com/");</span> </p></blockquote>
<p><strong>6、JSP下的301转向代码</strong></p>
<blockquote><p><span style="font-family: Verdana;">&lt;%<br />
response.setStatus(301);<br />
response.setHeader( "Location", "http://www.lesishu.com/" );<br />
response.setHeader( "Connection", "close" );<br />
%&gt;</span></p></blockquote>
<p><strong>7、Apache下301转向代码</strong></p>
<p>新建.htaccess文件，输入下列内容（需要开启mod_rewrite）：</p>
<p>1）将不带WWW的域名转向到带WWW的域名下</p>
<blockquote><p>Options +FollowSymLinks<br />
RewriteEngine on<br />
RewriteCond %{HTTP_HOST} ^lesishu.com [NC]<br />
RewriteRule ^(.*)$ http://www.lesishu.com/$1 [L,R=301]</p></blockquote>
<p>2）重定向到新域名</p>
<blockquote><p>Options +FollowSymLinks<br />
RewriteEngine on<br />
RewriteRule ^(.*)$ http://www.lesishu.com/$1 [L,R=301]</p></blockquote>
<p>3）使用正则进行301转向，实现伪静态</p>
<blockquote><p>Options +FollowSymLinks<br />
RewriteEngine on<br />
RewriteRule ^news-(.+).html$ news.php?id=$1</p></blockquote>
<p>将news.php?id=123这样的地址转向到news-123.html</p>
<p><strong>8、Apache下vhosts.conf中配置301转向</strong></p>
<p>为实现URL规范化，SEO通常将不带WWW的域名转向到带WWW域名，vhosts.conf中配置为：</p>
<blockquote><p>&lt;VirtualHost *:80&gt;<br />
ServerName www.lesishu.com<br />
DocumentRoot /home/lesishu<br />
&lt;/VirtualHost&gt;</p>
<p>&lt;VirtualHost *:80&gt;<br />
ServerName lesishu.com<br />
RedirectMatch permanent ^/(.*) http://www.lesishu.com/$1<br />
&lt;/VirtualHost&gt;</p></blockquote>
<p>Apache下除了以上2种方法，还有其他配置方法和可选参数，建议阅读<a href="http://httpd.apache.org/docs/" target="_blank">Apache文档</a>。</p>
<p><strong>301转向情况检测</strong></p>
<ol>
<li><a href="http://www.seoconsultants.com/tools/headers.asp" target="_blank">http://www.seoconsultants.com/tools/headers.asp</a></li>
<li><a href="http://www.internetofficer.com/seo-tool/redirect-check/" target="_blank">http://www.internetofficer.com/seo-tool/redirect-check/</a></li>
</ol>
<h2>相关文章</h2>
<ul class="related_post">
<li><a href="http://www.lesishu.com/seo/seo-datum-baffle/" title="SEO资料的迷思">SEO资料的迷思</a></li>
<li><a href="http://www.lesishu.com/net/advanced-web-ranking/" title="SEO工具: Advanced Web Ranking">SEO工具: Advanced Web Ranking</a></li>
<li><a href="http://www.lesishu.com/net/cnnic-21/" title="信息解读:CNNIC第21次互联网报告">信息解读:CNNIC第21次互联网报告</a></li>
<li><a href="http://www.lesishu.com/net/google-analytics-air-reporting-suite/" title="Google Analytics AIR Reporting Suite">Google Analytics AIR Reporting Suite</a></li>
<li><a href="http://www.lesishu.com/net/ibp10/" title="Internet Business Promoter(IBP) 10 发布">Internet Business Promoter(IBP) 10 发布</a></li>
<li><a href="http://www.lesishu.com/seo/parameter/" title="PaRaMeter (Google PR 检查工具) v1.2 绿色版">PaRaMeter (Google PR 检查工具) v1.2 绿色版</a></li>
<li><a href="http://www.lesishu.com/net/seo_elite/" title="SEO Elite 4.0 R40 商业原版 + 破解">SEO Elite 4.0 R40 商业原版 + 破解</a></li>
<li><a href="http://www.lesishu.com/seo/seo-tools/" title="SEO工具,站长必备">SEO工具,站长必备</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.lesishu.com/articles/301/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
	</channel>
</rss>
