首页 » 默认不分类 » wordpress伪静态规则postname版

wordpress伪静态规则postname版

本来想把博客移到blog目录并关闭伪静态,但发现百度和谷歌收录了很多,哎。以前写的规则又找不到了,这次记下来方便用。
首先固定链接那儿设成:/%category%/%postname%.html
如果您是linux主机,那么什么事也不用做了,可以用,如果是win主机,就要手工设规则。
然后修改http.ini文件 将下面的代码加入即可

RewriteRule /(about|tool|host|sort)/? /index\.php\?pagename=$1
#RewriteRule /category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?category_name=$1&feed=$2
RewriteRule /category/(.*)/page/(\d+) /index\.php\?category_name=$1&paged=$2
RewriteRule /category/(.*) /index\.php\?category_name=$1
#RewriteRule /author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?author_name=$1&feed=$2
RewriteRule /author/(.*)/? /index\.php\?author_name=$1
RewriteRule /feed/?$ /wp-feed\.php/\?feed=rss2
RewriteRule /comments/feed/?$ /wp-feed\.php/\?feed=comments-rss2
RewriteRule /page/(\d+) /index\.php\?paged=$1
RewriteRule /tag/(.*) /index\.php\?tag=$1
RewriteRule /(.*)/(.*).html/trackback/? /wp-trackback.php?p=$1
RewriteRule /(.*)/(.*).html$ /index\.php\?category_name=$1&name=$2
RewriteRule /([0-9]{4})/([0-9]{1,2})/?([0-9]{1,2})? /index.php\?year=$1&monthnum=$2&day=$3

, ,

转发到新浪微博 转发到新浪微博

目前这篇文章有3条评论(Rss)

  1. social | #1
    05/16/2012 at 10:24

    hks0UQ Fantastic article.Much thanks again.

  2. seo | #2
    05/17/2012 at 03:12

    adiXLN I truly appreciate this article post.Really thank you! Cool.

  3. bookmarking | #3
    05/17/2012 at 09:21

    k9mp6m Really informative blog article.Really thank you! Will read on…

我要评论