正文

Typecho是由国人开发的一套非常优秀的博客系统,代码短小,简单友好,最近也有个项目是用typecho搭建的,理所当然的对该程序有了一点探讨,最大的问题还是伪静态方面,官方没有给出iis和nginx的伪静态规则,还得我折腾老半天去搜索资料,还要测试兼容性,所幸忙了许久还是有收获的,下面我就发上各种web服务器搭建typecho的伪静态规则,省的大家麻烦去找

Apache

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>

Nginx

if (!-e $request_filename) {
    rewrite ^(.*)$ /index.php$1 last;
}

IIS

[ISAPI_Rewrite]
CacheClockRate 3600
RepeatLimit 32
RewriteRule /tag/(.*) /index\.php\?tag=$1
RewriteRule /sitemap.xml /sitemap.xml [L]
RewriteRule /favicon.ico /favicon.ico [L]
RewriteRule /(.*).html /index.php/$1.html [L]
RewriteRule /(.*)/comment /index.php/$1/comment [L]
RewriteRule /category/(.*) /index.php/category/$1 [L]
RewriteRule /page/(.*) /index.php/page/$1 [L]
RewriteRule /search/(.*) /index.php/search/$1 [L]
RewriteRule /feed/(.*) /index.php/feed/$1 [L]
RewriteRule /2(.*) /index.php/2$1 [L]
RewriteRule /action(.*) /index.php/action$1 [L]

规则是根据正式版1.1写的,如果有什么问题可以在下方评论提出。

如果觉得我的文章对你有用,请随意赞赏