IIS下 wordpress也可以有完美的rewrite
包含三种常用永久链接规则:
iis下 isapi_rewrite的规则
# 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
IIRF很简单,只要把上面的规则 右边的反斜线\都去掉就可以了。
上面都是别人写的,我感觉写的很好,每种需求都包括了,保存起来以后用起来方便。