<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[静怡家园]]></title> 
<link>http://www.zhanghaijun.com/index.php</link> 
<description><![CDATA[书山有路勤为径，学海无涯苦作舟！]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[静怡家园]]></copyright>
<item>
<link>http://www.zhanghaijun.com/post//</link>
<title><![CDATA[部分常用CMS的nginx伪静态规则]]></title> 
<author>碟舞飞扬 &lt;webmaster@zhanghaijun.com&gt;</author>
<category><![CDATA[服务器类]]></category>
<pubDate>Sat, 10 Mar 2012 16:49:18 +0000</pubDate> 
<guid>http://www.zhanghaijun.com/post//</guid> 
<description>
<![CDATA[ 
	WordPress<br/><div class="code"><br/>location / &#123;<br/>&nbsp;&nbsp;if (-f $request_filename/index.html)&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;rewrite (.*) $1/index.html break;<br/>&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;if (-f $request_filename/index.php)&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;rewrite (.*) $1/index.php;<br/>&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;if (!-f $request_filename)&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;rewrite (.*) /index.php;<br/>&nbsp;&nbsp;&#125;<br/>&#125;<br/></div><br/>WordPress Mu<br/><div class="code"><br/>location /&#123;<br/>&nbsp;&nbsp;server_name_in_redirect off;<br/>&nbsp;&nbsp;port_in_redirect off;<br/> <br/>&nbsp;&nbsp;rewrite ^.*/files/(.*) /wp-includes/ms-files.php?file=$1;<br/>&nbsp;&nbsp;rewrite ^/files/(.+) /wp-includes/ms-files.php?file=$1;<br/> <br/>&nbsp;&nbsp;if (!-e $request_filename) &#123;<br/>&nbsp;&nbsp;rewrite ^.+?(/wp-.*) $1 last;<br/>&nbsp;&nbsp;rewrite ^.+?(/.*&#92;.php)$ $1 last;<br/>&nbsp;&nbsp;rewrite ^ /index.php last;<br/>&nbsp;&nbsp;&#125;<br/>&#125;<br/></div><br/>Drupal<br/><div class="code"><br/>location / &#123;<br/>&nbsp;&nbsp;if (!-e $request_filename) &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/(.*)$ /index.php?q=$1 last;<br/>&nbsp;&nbsp;&#125;<br/>&#125;<br/></div><br/>Twip<br/><div class="code"><br/>location /&#123;<br/>&nbsp;&nbsp;if (!-e $request_filename)&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/(.*)$ /index.php last;<br/>&nbsp;&nbsp;&#125;<br/>&#125;<br/></div><br/>Typecho<br/><div class="code"><br/>location / &#123;<br/>&nbsp;&nbsp;index index.html index.php;<br/>&nbsp;&nbsp;if (-f $request_filename/index.html)&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;rewrite (.*) $1/index.html break;<br/>&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;if (-f $request_filename/index.php)&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;rewrite (.*) $1/index.php;<br/>&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;if (!-f $request_filename)&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;rewrite (.*) /index.php;<br/>&nbsp;&nbsp;&#125;<br/>&#125;<br/></div><br/>Discuz<br/><div class="code"><br/>location / &#123;<br/>&nbsp;&nbsp;rewrite ^/archiver/((fid&#124;tid)-&#91;&#92;w&#92;-&#93;+&#92;.html)$ /archiver/index.php?$1 last;<br/>&nbsp;&nbsp;rewrite ^/forum-(&#91;0-9&#93;+)-(&#91;0-9&#93;+)&#92;.html$ /forumdisplay.php?fid=$1&amp;amp;page=$2 last;<br/>&nbsp;&nbsp;rewrite ^/thread-(&#91;0-9&#93;+)-(&#91;0-9&#93;+)-(&#91;0-9&#93;+)&#92;.html$ /viewthread.php?tid=$1&amp;amp;extra=page%3D$3&amp;amp;page=$2 last;<br/>&nbsp;&nbsp;rewrite ^/space-(username&#124;uid)-(.+)&#92;.html$ /space.php?$1=$2 last;<br/>&nbsp;&nbsp;rewrite ^/tag-(.+)&#92;.html$ /tag.php?name=$1 last;<br/>&#125;<br/></div><br/>Discuz X<br/><div class="code"><br/>location / &#123;<br/>&nbsp;&nbsp;rewrite ^(&#91;^&#92;.&#93;*)/topic-(.+)&#92;.html$ $1/portal.php?mod=topic&amp;topic=$2 last;<br/>&nbsp;&nbsp;rewrite ^(&#91;^&#92;.&#93;*)/article-(&#91;0-9&#93;+)-(&#91;0-9&#93;+)&#92;.html$ $1/portal.php?mod=view&amp;aid=$2&amp;page=$3 last;<br/>&nbsp;&nbsp;rewrite ^(&#91;^&#92;.&#93;*)/forum-(&#92;w+)-(&#91;0-9&#93;+)&#92;.html$ $1/forum.php?mod=forumdisplay&amp;fid=$2&amp;page=$3 last;<br/>&nbsp;&nbsp;rewrite ^(&#91;^&#92;.&#93;*)/thread-(&#91;0-9&#93;+)-(&#91;0-9&#93;+)-(&#91;0-9&#93;+)&#92;.html$ $1/forum.php?mod=viewthread&amp;tid=$2&amp;extra=page%3D$4&amp;page=$3 last;<br/>&nbsp;&nbsp;rewrite ^(&#91;^&#92;.&#93;*)/group-(&#91;0-9&#93;+)-(&#91;0-9&#93;+)&#92;.html$ $1/forum.php?mod=group&amp;fid=$2&amp;page=$3 last;<br/>&nbsp;&nbsp;rewrite ^(&#91;^&#92;.&#93;*)/space-(username&#124;uid)-(.+)&#92;.html$ $1/home.php?mod=space&amp;$2=$3 last;<br/>&nbsp;&nbsp;rewrite ^(&#91;^&#92;.&#93;*)/(&#91;a-z&#93;+)-(.+)&#92;.html$ $1/$2.php?rewrite=$3 last;<br/>&nbsp;&nbsp;if (!-e $request_filename) &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;return 404;<br/>&nbsp;&nbsp;&#125;<br/>&#125;<br/></div><br/>Dabr<br/><div class="code"><br/>location / &#123;<br/>&nbsp;&nbsp;if (!-e $request_filename) &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/(.*)$ /index.php?q=$1 last;<br/>&nbsp;&nbsp;&#125;<br/>&#125;<br/></div><br/>SaBlog<br/><div class="code"><br/>location / &#123;<br/>&nbsp;&nbsp;rewrite “^/date/(&#91;0-9&#93;&#123;6&#125;)/?(&#91;0-9&#93;+)?/?$” /index.php?action=article&amp;setdate=$1&amp;page=$2 last;<br/>&nbsp;&nbsp;rewrite ^/page/(&#91;0-9&#93;+)?/?$ /index.php?action=article&amp;page=$1 last;<br/>&nbsp;&nbsp;rewrite ^/category/(&#91;0-9&#93;+)/?(&#91;0-9&#93;+)?/?$ /index.php?action=article&amp;cid=$1&amp;page=$2 last;<br/>&nbsp;&nbsp;rewrite ^/category/(&#91;^/&#93;+)/?(&#91;0-9&#93;+)?/?$ /index.php?action=article&amp;curl=$1&amp;page=$2 last;<br/>&nbsp;&nbsp;rewrite ^/(archives&#124;search&#124;article&#124;links)/?$ /index.php?action=$1 last;<br/>&nbsp;&nbsp;rewrite ^/(comments&#124;tagslist&#124;trackbacks&#124;article)/?(&#91;0-9&#93;+)?/?$ /index.php?action=$1&amp;page=$2 last;<br/>&nbsp;&nbsp;rewrite ^/tag/(&#91;^/&#93;+)/?(&#91;0-9&#93;+)?/?$ /index.php?action=article&amp;item=$1&amp;page=$2 last;<br/>&nbsp;&nbsp;rewrite ^/archives/(&#91;0-9&#93;+)/?(&#91;0-9&#93;+)?/?$ /index.php?action=show&amp;id=$1&amp;page=$2 last;<br/>&nbsp;&nbsp;rewrite ^/rss/(&#91;^/&#93;+)/?$ /rss.php?url=$1 last;<br/>&nbsp;&nbsp;rewrite ^/user/(&#91;^/&#93;+)/?(&#91;0-9&#93;+)?/?$ /index.php?action=article&amp;user=$1&amp;page=$2 last;<br/>&nbsp;&nbsp;rewrite sitemap.xml sitemap.php last;<br/>&nbsp;&nbsp;rewrite ^(.*)/(&#91;0-9a-zA-Z&#92;-&#92;_&#93;+)/?(&#91;0-9&#93;+)?/?$ $1/index.php?action=show&amp;alias=$2&amp;page=$3 last;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/></div><br/>Xnote<br/><div class="code"><br/>location / &#123;<br/>&nbsp;&nbsp;if (!-e $request_filename) &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;rewrite &quot;^/(&#91;A-Za-z0-9&#92;-&#93;&#123;4,20&#125;)$&quot; /index.php?url=$1 last;<br/>&nbsp;&nbsp;&#125;<br/>&#125;<br/></div><br/>Status.net<br/><div class="code"><br/>location / &#123;<br/>&nbsp;&nbsp;if (-f $request_filename/index.html)&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;rewrite (.*) $1/index.html break;<br/>&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;if (-f $request_filename/index.php)&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;rewrite (.*) $1/index.php;<br/>&nbsp;&nbsp;&#125;<br/>&nbsp;&nbsp;if (!-f $request_filename)&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;rewrite (.*) /index.php;<br/>&nbsp;&nbsp;&#125;<br/>&#125;<br/></div><br/>PHP-Wind<br/><div class="code"><br/>location / &#123;<br/>rewrite ^thread-htm-tid-(&#92;d+)-(.*).html&nbsp;&nbsp;thread.php?fid=$1 last;<br/>rewrite ^read-htm-tid-(&#92;d+)-(.*).html&nbsp;&nbsp;read.php?tid=$1 last;<br/>rewrite ^commtopics-(.*)-(.*)&nbsp;&nbsp;thread.php?fid=$1&amp;page=$2 last;<br/>rewrite ^commtopics-(.*)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; thread.php?fid=$1&amp;page=$2 last;<br/>rewrite ^article-(.*)-(.*)-(.*).html&nbsp;&nbsp;read.php?tid=$1&amp;page=$2&amp;fpage=$3 last;<br/>rewrite ^article-(.*)-(.*).html&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; read.php?tid=$1&amp;page=$2&amp;fpage=$3 last;<br/>rewrite ^article-(.*).html&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;read.php?tid=$1 last;<br/>rewrite ^read-htm-tid-(&#92;d+)-(.*).html&nbsp;&nbsp;read.php&#92;?tid=$1 last;<br/>rewrite ^(.*)-htm-(.*)$ $1.php?$2 last;<br/>rewrite ^(.*)/simple/(&#91;a-z0-9&#92;_&#93;+&#92;.html)$ $1/simple/index.php?$2 last;<br/>rewrite ^(.*)/u/(&#91;0-9&#93;+)$ $1/u.php?uid=$2 last;<br/>&#125;<br/></div><br/>Bo-Blog<br/><div class="code"><br/>location / &#123;<br/>&nbsp;&nbsp; if (!-e $request_filename)<br/>&nbsp;&nbsp; &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/post/(&#91;0-9&#93;+)/?(&#91;0-9&#93;+)?/?(&#91;0-9&#93;+)?/?$ /read.php?entryid=$1&amp;page=$2&amp;part=$3 last;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/page/(&#91;0-9&#93;+)/(&#91;0-9&#93;+)/?$ /index.php?mode=$1&amp;page=$2 last;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/starred/(&#91;0-9&#93;+)/?(&#91;0-9&#93;+)?/?$ /star.php?mode=$1&amp;page=$2 last;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/category/(&#91;^/&#93;+)/?(&#91;0-9&#93;+)?/?(&#91;0-9&#93;+)?/?$ /index.php?go=category_$1&amp;mode=$2&amp;page=$3 last;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/archiver/(&#91;0-9&#93;+)/(&#91;0-9&#93;+)/?(&#91;0-9&#93;+)?/?(&#91;0-9&#93;+)?/?$ /index.php?go=archive&amp;cm=$1&amp;cy=$2&amp;mode=$3&amp;page=$4 last;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/date/(&#91;0-9&#93;+)/(&#91;0-9&#93;+)/(&#91;0-9&#93;+)/?(&#91;0-9&#93;+)?/?(&#91;0-9&#93;+)?/?$ /index.php?go=showday_$1-$2-$3&amp;mode=$4&amp;page=$5 last;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/user/(&#91;0-9&#93;+)/?$ /view.php?go=user_$1 last;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/tags/(&#91;^/&#93;+)/?(&#91;0-9&#93;+)?/?(&#91;0-9&#93;+)?/?$ /tag.php?tag=$1&amp;mode=$2&amp;page=$3 last;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/component/id/(&#91;0-9&#93;+)/?$ /page.php?pageid=$1 last;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/component/(&#91;^/&#93;+)/?$ /page.php?pagealias=$1 last;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#Force redirection for old rules<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/read&#92;.php/(&#91;0-9&#93;+)&#92;.htm$ http://$host/post/$1/ permanent;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/post/(&#91;0-9&#93;+)&#92;.htm$ http://$host/post/$1/ permanent;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/post/(&#91;0-9&#93;+)&#92;_(&#91;0-9&#93;+)&#92;.htm$ http://$host/post/$1/$2/ permanent;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/post/(&#91;0-9&#93;+)&#92;_(&#91;0-9&#93;+)&#92;_(&#91;0-9&#93;+)&#92;.htm$ http://$host/post/$1/$2/$3/ permanent;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/index&#92;_(&#91;0-9&#93;+)&#92;_(&#91;0-9&#93;+)&#92;.htm$ http://$host/page/$1/$2/ permanent;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/star&#92;_(&#91;0-9&#93;+)&#92;_(&#91;0-9&#93;+)&#92;.htm$ http://$host/starred/$1/$2/ permanent;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/category&#92;_(&#91;0-9&#93;+)&#92;.htm$ http://$host/category/$1/ permanent;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/category&#92;_(&#91;0-9&#93;+)&#92;_(&#91;0-9&#93;+)&#92;_(&#91;0-9&#93;+)&#92;.htm$ http://$host/category/$1/$2/$3/ permanent;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/archive&#92;_(&#91;0-9&#93;+)&#92;_(&#91;0-9&#93;+)&#92;.htm$ http://$host/archiver/$1/$2/ permanent;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/archive&#92;_(&#91;0-9&#93;+)&#92;_(&#91;0-9&#93;+)&#92;_(&#91;0-9&#93;+)&#92;_(&#91;0-9&#93;+)&#92;.htm$ http://$host/archiver/$1/$2/$3/$4/ permanent;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/showday&#92;_(&#91;0-9&#93;+)&#92;_(&#91;0-9&#93;+)&#92;_(&#91;0-9&#93;+)&#92;.htm$ http://$host/date/$1/$2/$3/ permanent;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/showday&#92;_(&#91;0-9&#93;+)&#92;_(&#91;0-9&#93;+)&#92;_(&#91;0-9&#93;+)&#92;_(&#91;0-9&#93;+)&#92;_(&#91;0-9&#93;+)&#92;.htm$ http://$host/date/$1/$2/$3/$4/$5/ permanent;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#Filename alias<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewrite ^/(&#91;a-zA-Z0-9_-&#93;+)/?(&#91;0-9&#93;+)?/?(&#91;0-9&#93;+)?/?$ /read.php?blogalias=$1&amp;page=$2&amp;part=$3 last;<br/>&nbsp;&nbsp; &#125;<br/>&#125;<br/></div><br/>Tags - <a href="http://www.zhanghaijun.com/tags/nginx/" rel="tag">nginx</a> , <a href="http://www.zhanghaijun.com/tags/rewrite/" rel="tag">rewrite</a>
]]>
</description>
</item><item>
<link>http://www.zhanghaijun.com/post//#blogcomment</link>
<title><![CDATA[[评论] 部分常用CMS的nginx伪静态规则]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.zhanghaijun.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>