<?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>BestJQ &#187; tag</title>
	<atom:link href="http://bestjq.com/tag/tag/feed/" rel="self" type="application/rss+xml" />
	<link>http://bestjq.com</link>
	<description>Life is like a box of chocolate,You never know what you’re gonna get</description>
	<lastBuildDate>Sun, 17 Jul 2011 11:10:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Windows主机下WordPress的tag解决办法</title>
		<link>http://bestjq.com/windows-wordpress/</link>
		<comments>http://bestjq.com/windows-wordpress/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 07:28:13 +0000</pubDate>
		<dc:creator>Visionaer</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[tag]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://bestjq.com/?p=81</guid>
		<description><![CDATA[国内还是有很多的主机是用IIS+php+mysql搭建的，对于使用wordpress的用户来说，服务器是windows系统的话下一定遇到过以下2钟情况
1.永久链接中的问题，在链接中会有“index.php”，这个问题可以通过伪静态处理的方法来解决]]></description>
			<content:encoded><![CDATA[<p>国内还是有很多的主机是用IIS+php+mysql搭建的，对于使用wordpress的用户来说，服务器是windows系统的话下一定遇到过以下2钟情况<br />
1.永久链接中的问题，在链接中会有“index.php”，这个问题可以通过伪静态处理的方法来解决<br />
2.tag中中文tag的链接转向404<br />
昨天无意中发现第二个问题没有解决，现在提供解决办法供参考<br />
首先我尝试了修改rewrite.php，此法如下：</p>
<p>打开wp-includes下rewrite.php<br />
<code>function get_tag_permastruct() {<br />
if (isset($this-&gt;tag_structure)) {<br />
return $this-&gt;tag_structure;<br />
}</code></p>
<p><strong>if (empty($this-&gt;permalink_structure)) {</strong><br />
$this-&gt;tag_structure = ”;<br />
return false;<br />
}</p>
<p>把黑体部分替换成<code><strong>if (! empty($this-&gt;permalink_structure)) {</strong></code></p>
<p>此法确实能够解决连接问题，但是修改后tag的链接格式会变成系统默认的/?tag=%tag%/,经过摸索修改下面一行可能能解决格式问题，但是经过尝试，失败。欢迎高手赐教。</p>
<p>于是找了第二种解决方案：修改classes.php</p>
<p>打开wp-includes下classes.php</p>
<p>找到45行（2.7版本中为152行）开始</p>
<p><code>if ( isset($_SERVER['PATH_INFO']) )<br />
<strong> $pathinfo = $_SERVER['PATH_INFO'];</strong><br />
else<br />
$pathinfo = '';<br />
$pathinfo_array = explode('?', $pathinfo);<br />
$pathinfo = str_replace("%", "%25", $pathinfo_array[0]);<br />
<strong> $req_uri = $_SERVER['REQUEST_URI']</strong>;</code></p>
<p>修改为</p>
<p><code>if ( isset($_SERVER['PATH_INFO']) )<br />
<strong>$pathinfo = mb_convert_encoding($_SERVER['PATH_INFO'],"utf-8","gbk");</strong><br />
else<br />
$pathinfo = '';<br />
$pathinfo_array = explode('?', $pathinfo);<br />
$pathinfo = str_replace("%", "%25", $pathinfo_array[0]);<br />
<strong>$req_uri = mb_convert_encoding($_SERVER['REQUEST_URI'],"utf-8","gbk");</strong></code></p>
<p>通过这种方法修改能保持原来的永久链接方式，效果不错</p>
<p>注意：代码可能会因编码问题复制出错，建议使用英文输入对照黑体部分手动修改;改rewrite.php过程中不要修改永久链接中相关设置，不然会出现所有tag的链接都转向404页</p>
<p>OK,enjoy it!</p>
]]></content:encoded>
			<wfw:commentRss>http://bestjq.com/windows-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

