代码笔记

亲测Wordpress在iis下的可以用的几个伪静态规则

阅读

原来我的博客是在Apache环境下的,开启伪静态模式下Wordpress自然就可以用了!可最近因为空间搬家到了WIN主机下,自然是要用iis了!以前设置的静态规则就都不好用了!在网上找了很多种方法,终于发现了一些不错的静态规则,下面分享给大家!

 

保存为httpd.ini存入你的虚拟主机根目录,一般就搞定了!Wordpress 2.9.2下测试通过!

 

第一种形式:年/月/日/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.okjn.cn

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页:
  • 上一页
  • 1
  • 2
  • 下一页

  • 推荐阅读

    用dede调用wordpress数据-文
    用dede调用wordpress数据...