路由人生 网站设计 WordPress URL规则for IIS ISAPI ReWrite

WordPress URL规则for IIS ISAPI ReWrite

WordPress URL规则IIS ISAPI ReWrite
适用版本:wordpress2.3+
包含三种常用永久链接规则:

  • /post/%post_id%.html
  • /%year%/%monthnum%/%day%/%postname%/
  • /%year%/%monthnum%/%day%/%postname%.html

前提需要你的windows主机 支持 ISAPI ReWrite

详细规则如下:

  • [ISAPI_Rewrite]
  • # 3600 = 1 hour
  • CacheClockRate 3600
  • RepeatLimit 32
  • # Protect httpd.ini and httpd.parse.errors files
  • # from accessing through HTTP
  • # # WordPress rewrite rules#
  • # # Below is for permalink like /post/%post_id%.html
  • # # Provided By Sideblue
  • # # URL:http://www.xbaohe.com
  • RewriteRule /post/tag/(.*) /index\.php\?tag=$1
  • RewriteRule /tag/(.*) /index\.php\?tag=$1
  • RewriteRule /(contact|about-copyright|favor|archives|tags|sitemap) /index\.php\?pagename=$1
  • RewriteRule /post/category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?category_name=$1&feed=$2
  • RewriteRule /post/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 /rss.xml /wp-feed\.php/\?feed=rss2
  • RewriteRule /feed/?$ /wp-feed\.php/\?feed=rss2
  • RewriteRule /comments/feed/?$ /wp-feed\.php/\?feed=comments-rss2
  • # RewriteRule /([0-9]+)/?([0-9]+)?/?$ /index\.php\?p=$1&page=$2
  • # RewriteRule /post/([0-9]+)/?([0-9]+)?/?$ /index\.php\?p=$1&page=$2
  • RewriteRule /post/([0-9]+).html /index\.php\?p=$1
  • RewriteRule /page/(.*)/?s=(.*) /index\.php\?s=$2&paged=$1
  • RewriteRule /page/(.*) /index\.php\?paged=$1
  • RewriteRule /post/date/([0-9]{4})([0-9]{1,2})([0-9]{1,2})/([^/]+)/?([0-9]+)?/?$ /index\.php\?year=$1&monthnum=$2&day=$3&name=$4&page=$5
  • RewriteRule /post/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&day=$3&page=$4
  • RewriteRule /post/date/([0-9]{4})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&page=$3
  • RewriteRule /post/([0-9]+).html/(feed|rdf|rss|rss2|atom) /index\.php\?feed=rss2&p=$1
  • RewriteRule /post/([0-9]+).html/trackback /wp-trackback\.php\?p=$1
  • # # Below is for permalink like /%year%/%monthnum%/%day%/%postname%.html
  • # # Maybe dumplicate with above!!
  • # # Provided By Sideblue
  • # # URL:http://www.xbaohe.com
  • RewriteRule /tag/(.*) /index\.php\?tag=$1
  • RewriteRule /(contact|about-copyright|favor|archives|tags|sitemap)/ /index\.php\?pagename=$1
  • RewriteRule /category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?category_name=$1&feed=$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/(.*)/ /index\.php\?paged=$1
  • RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/?([0-9]+)?.html/?$ /index\.php\?year=$1&monthnum=$2&day=$3&name=$4&page=$5
  • RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&day=$3&page=$4
  • RewriteRule /([0-9]{4})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&page=$3
  • RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+).html/(feed|rdf|rss|rss2|atom)/?$ /index\.php\?year=$1&monthnum=$2&day=$3&name=$4&feed=$5
  • RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+).html/trackback/?$ /wp-trackback\.php\?year=$1&monthnum=$2&day=$3&name=$4&tb=1
  • # # Below is for permalink like /%year%/%monthnum%/%day%/%postname%/
  • # # Maybe dumplicate with above!!
  • # # Provided By Sideblue
  • # # URL:http://www.xbaohe.com
  • RewriteRule /tag/(.*) /index\.php\?tag=$1
  • RewriteRule /(contact|about-copyright|favor|archives|tags|sitemap)/ /index\.php\?pagename=$1
  • RewriteRule /category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?category_name=$1&feed=$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/(.*)/ /index\.php\?paged=$1
  • RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/?([0-9]+)?/?$ /index\.php\?year=$1&monthnum=$2&day=$3&name=$4&page=$5
  • RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&day=$3&page=$4
  • RewriteRule /([0-9]{4})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&page=$3
  • RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ /index\.php\?year=$1&monthnum=$2&day=$3&name=$4&feed=$5
  • RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/trackback/?$ /wp-trackback\.php\?year=$1&monthnum=$2&day=$3&name=$4&tb=1
  • # # Below is For Discuz!
  • RewriteRule ^(.*)/archiver/([a-z0-9\-]+\.html)$ $1/archiver/index\.php\?$2
  • RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html$ $1/forumdisplay\.php\?fid=$2&page=$3
  • RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/viewthread\.php\?tid=$2&extra=page\%3D$4&page=$3
  • RewriteRule ^(.*)/profile-(username|uid)-(.+)\.html$ $1/viewpro\.php\?$2=$3
  • RewriteCond Host: (.+)
  • RewriteCond Referer: (?!http://\1.*).*
  • RewriteRule .*\.(?:gif|jpg|png) /block.gif
本文来自网络,不代表路由人生立场,转载请注明出处。

作者: myweb

发表评论

联系我们

联系我们

0898-0102021

在线咨询: QQ交谈

邮箱: yufe@yufe.me

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部