首页    >    新闻资讯    >   WordPress在Windows下的ISAPI_ReWrite伪静态规则

WordPress在Windows下的ISAPI_ReWrite伪静态规则

在Wordpress2.6.5版下测试可用。

#IIS ISAPI_Rewrite For WordPress:

形式1:年/月/日/Postname.html

[ISAPI_Rewrite]

# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP

# # 形式:年/月/日/Postname.html
# # 自定义链接 /%year%/%monthnum%/%day%/%postname%.html
# # URL:http://www.dengjin.com

RewriteRule /tag/(.*) /index.php?tag=$1
RewriteRule /(about|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

形式2:形式:年/月/日/Postname/

[ISAPI_Rewrite]

# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP

# # 形式:年/月/日/Postname/
# # 自定义链接 /%year%/%monthnum%/%day%/%postname%/
# # URL:http://www.dengjin.com

RewriteRule /tag/(.*) /index.php?tag=$1
RewriteRule /(about|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


形式3:/post/PostID.html

[ISAPI_Rewrite]

# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP

# # 形式:/post/PostID.html
# # 自定义链接 /post/%post_id%.html
# # URL:http://www.dengjin.com

RewriteRule /post/tag/(.*) /index.php?tag=$1
RewriteRule /tag/(.*) /index.php?tag=$1
RewriteRule /(about|contact|about-copyright|favor|archives|tags|sitemap|taotao) /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

分类:新闻资讯

标签:, ,

* 版权声明:作者WordPress啦! 转载请注明出处。