首页 » netsoft » WordPress在IIS下的Rewrite规则

WordPress在IIS下的Rewrite规则

 

原来本站是在IIS下建立的,不过由于WORDPRESS的REWRITE规则一直搞不好,FEED的RSS那里显示不出来,所以一气之下,把主机换成了LINUX系统的主机,REWRITE一下就搞好了。LINUX下确实方便很多,但我还是在查找关于IIS下的REWRITE规则,今天我看到一个BLOG上有此规则,特意转载一下,让在WINDOWS IIS下使用WORDPRESS的朋友参考一下。

httpd.ini内容:

规则为"/%year%%monthnum%%day%/%postname%/"

[ISAPI_Rewrite] # WordPress rewrite rules
# Design by Kevin http://www.bluefeel.com
# /%year%%monthnum%%day%/%postname%/
RewriteRule /tag/(.*) /index\.php\?tag=$1
RewriteRule /(about-kevin|about-copyright|my-favorite-music)/ /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

规则作者:kevin
原文地址:http://www.bluefeel.com/?action=show&id=381

原文链接:WordPress在IIS下的Rewrite规则,转载请注明来源!

如果您有更好建议,您可以联系我们!

0