Typecho 程序WINdows2003系统下的2种伪静态httpd.ini自适应规则
    文章作者:恒爱网络 阅读次数:6487 发布时间:2017-4-7

    Typecho 程序默认自带的规则需要高版本的  rewrite.dll 组件来支持,大约都是 3.1以上的。

    网上也有破解版的rewrite 3.1 ,Typecho自带的适应3.1的规则如下:


    [ISAPI_Rewrite]
    # 3600 = 1 hour
    CacheClockRate 3600
    RepeatLimit 32
    # 中文tag解决
    RewriteRule /tag/(.*) /index.php?tag=$1
    # sitemapxml
    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]
    # feed
    RewriteRule /feed/(.*) /index.php/feed/$1 [L]
    # 日期归档
    RewriteRule /2(.*) /index.php/2$1 [L]
    # 上传图片等
    RewriteRule /action(.*) /index.php/action$1 [L]



    如果是低版本的rewrite.dll 譬如 1.X ,2.X 的,那就要用到下面的规则了:


    [ISAPI_Rewrite]
    RewriteRule ^/admin(.*) /admin/$1 [L]
    RewriteRule ^(.*)(html|htm)$ /index.php/$1$2 [L]
    RewriteRule ^([^.]+)$ /index.php/$1 [L]
    第一条 重定向后台地址
    第二条 将带html htm 后缀的重写
    第三条 排除带"."的 其余的全部重写




    而下面这个好像是WP的,只做参考用

    [ISAPI_Rewrite]
    # 3600 = 1 hour
    CacheClockRate 3600
    RepeatLimit 32
    # Protect httpd.ini and httpd.parse.errors files
    # from accessing through HTTP
    # Rules to ensure that normal content gets through
    RewriteRule /sitemap.xml /sitemap.xml [L]
    RewriteRule /favicon.ico /favicon.ico [L]
    # For file-based wordpress content (i.e. theme), admin, etc.
    RewriteRule /wp-(.*) /wp-$1 [L]
    # For normal wordpress content, via index.php
    RewriteRule ^/$ /index.php [L]
    RewriteRule /(.*) /index.php/$1 [L]


    注:记得到后台永久链接设置里,启用地址重写功能。