<?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>baalchina &#187; rewrite</title>
	<atom:link href="http://www.baalchina.net/tag/rewrite/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.baalchina.net</link>
	<description>baalchina技术日志</description>
	<lastBuildDate>Mon, 19 Jul 2010 08:30:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Wordpress的Rewrite/永久链接(permalinks )设置</title>
		<link>http://www.baalchina.net/2008/08/wordpress-permalinks/</link>
		<comments>http://www.baalchina.net/2008/08/wordpress-permalinks/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 06:35:13 +0000</pubDate>
		<dc:creator>baalchina</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[未分类]]></category>
		<category><![CDATA[rewrite]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://baalchina.nau.edu.cn/?p=79</guid>
		<description><![CDATA[wp的rewrite机制和之前遇到的DZ等不同，稍费了点功夫。

首先Apache必须要支持Rewrite，加载好mod_rewrite。
其次，WP处理的规则是通过wp目录下的.htaccess文件，如果请求的不是文件或者目录，就交由index.php处理。而非通过Rewrite将连接进行静态化。所有需要将这个.htaccess设置为可写属性。
Apache要使用这个.htaccess，需要在Directory目录添加“AllowOverride FileInfo, AllowOverride All”。同时还要“FollowSymLinks option”。

参考文章：
分析WordPress的Rewrite机制
http://www.black-xstar.com/blog/article.asp?id=546
WP官网文章
http://codex.wordpress.org/Using_Permalinks#Creating_and_editing_.28.htaccess.29
另外，Wordpress的.htaccsee内容如下：

?View Code XML1
2
3
4
5
6
7
&#60;IfModule mod_rewrite.c&#62;
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
&#60;/IfModule&#62;

]]></description>
			<content:encoded><![CDATA[<blockquote><p>wp的rewrite机制和之前遇到的DZ等不同，稍费了点功夫。</p></blockquote>
<ol>
<li>首先Apache必须要支持Rewrite，加载好mod_rewrite。</li>
<li>其次，WP处理的规则是通过wp目录下的.htaccess文件，如果请求的不是文件或者目录，就交由index.php处理。而非通过Rewrite将连接进行静态化。所有需要将这个.htaccess设置为可写属性。</li>
<li>Apache要使用这个.htaccess，需要在Directory目录添加“AllowOverride FileInfo, AllowOverride All”。同时还要“FollowSymLinks option”。</li>
</ol>
<p>参考文章：</p>
<p>分析WordPress的Rewrite机制<br />
<a href="http://www.black-xstar.com/blog/article.asp?id=546">http://www.black-xstar.com/blog/article.asp?id=546</a></p>
<p>WP官网文章<br />
<a href="http://codex.wordpress.org/Using_Permalinks#Creating_and_editing_.28.htaccess.29">http://codex.wordpress.org/Using_Permalinks#Creating_and_editing_.28.htaccess.29</a></p>
<p>另外，Wordpress的.htaccsee内容如下：</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p79code2'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p792"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p79code2"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;IfModule</span> mod_rewrite.c<span style="color: #000000; font-weight: bold;">&gt;</span></span>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/IfModule<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.baalchina.net/2008/08/wordpress-permalinks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nginx下只针对logging.php进行https处理的重写规则</title>
		<link>http://www.baalchina.net/2008/08/nginx-https-rewrite/</link>
		<comments>http://www.baalchina.net/2008/08/nginx-https-rewrite/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 13:01:57 +0000</pubDate>
		<dc:creator>baalchina</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[rewrite]]></category>

		<guid isPermaLink="false">http://baalchina.nau.edu.cn/?p=51</guid>
		<description><![CDATA[在https server下加入如下配置：

?View Code PHPif &#40;$uri !~* &#34;/logging.php$&#34;&#41;
&#123;
rewrite ^/&#40;.*&#41;$ http://$host/$1 redirect;
&#125;

在http server下加入如下配置：

?View Code PHPif &#40;$uri ~* &#34;/logging.php$&#34;&#41;
&#123;
rewrite ^/&#40;.*&#41;$ https://$host/$1 redirect;
&#125;

最后结果就是，用户会且只会在访问logging.php的情况下，才会通过https访问。有效地避免了arp欺骗、嗅探等方法盗取账号密码的行为。
感谢nginx作者的帮助。
http://marc.info/?l=nginx&#38;m=121663148102512&#38;w=2
]]></description>
			<content:encoded><![CDATA[<p>在https server下加入如下配置：</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p51code5'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p515"><td class="code" id="p51code5"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$uri</span> <span style="color: #339933;">!</span>~<span style="color: #339933;">*</span> <span style="color: #0000ff;">&quot;/logging.php$&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
rewrite ^<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">.*</span><span style="color: #009900;">&#41;</span>$ http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//$host/$1 redirect;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>在http server下加入如下配置：</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p51code6'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p516"><td class="code" id="p51code6"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$uri</span> ~<span style="color: #339933;">*</span> <span style="color: #0000ff;">&quot;/logging.php$&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
rewrite ^<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">.*</span><span style="color: #009900;">&#41;</span>$ https<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//$host/$1 redirect;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>最后结果就是，用户会且只会在访问logging.php的情况下，才会通过https访问。有效地避免了arp欺骗、嗅探等方法盗取账号密码的行为。</p>
<p>感谢nginx作者的帮助。<br />
<a href="http://marc.info/?l=nginx&amp;m=121663148102512&amp;w=2">http://marc.info/?l=nginx&amp;m=121663148102512&amp;w=2</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.baalchina.net/2008/08/nginx-https-rewrite/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
