WordPress中文论坛 - WordPress Chinese Forums

 找回密码
 注册
查看: 19880|回复: 6

求wordpress的IIS rewrite 规则

[复制链接]

15

主题

79

帖子

136

金钱

WP 老手

Rank: 3Rank: 3Rank: 3

积分
209
发表于 2009-10-21 14:55:36 | 显示全部楼层 |阅读模式
租了个windows的主机,固定链接rewrite需要写在httpd.ini里面,对这东西不是很了解...

网上搜索了有通过加载第三方dll来实现的,但是租的空间里面没有。

想弄成的固定链接这样子的,不知道哪位大侠使用的规则和我一样,谢谢。

/%year%/%monthnum%/%postname%.html

2

主题

468

帖子

541

金钱

WP 大师

Rank: 7Rank: 7Rank: 7Rank: 7

积分
1154
发表于 2009-10-21 15:23:27 | 显示全部楼层
别找了,根本就没有完美的。

7

主题

214

帖子

247

金钱

WP 老手

小众站点编辑

Rank: 3Rank: 3Rank: 3

积分
482
发表于 2009-10-21 21:37:11 | 显示全部楼层
有啊,我就是

4

主题

80

帖子

20

金钱

WP 熟手

Rank: 2Rank: 2

积分
184
发表于 2009-10-21 23:30:26 | 显示全部楼层
我的规则是/%postname%.html  有这样的规则rewrite吗?

17

主题

67

帖子

20

金钱

WP 熟手

Rank: 2Rank: 2

积分
182
发表于 2009-11-23 02:54:26 | 显示全部楼层

  1. [ISAPI_Rewrite]
  2. # 3600 = 1 hour
  3. CacheClockRate 3600
  4. RepeatLimit 32
  5. # Protect httpd.ini and httpd.parse.errors files
  6. # from accessing through HTTP
  7. # # WordPress rewrite rules#
  8. # # Below is for permalink like /post/%post_id%.html
  9. # # Provided By 虫虫
  10. # # URL:http://www.lply.org
  11. RewriteRule /post/tag/(.*) /index\.php\?tag=$1
  12. RewriteRule /tag/(.*) /index\.php\?tag=$1
  13. RewriteRule /(contact|about-copyright|favor|archives|tags|sitemap) /index\.php\?pagename=$1
  14. RewriteRule /post/category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?category_name=$1&feed=$2
  15. RewriteRule /post/category/?(.*) /index\.php\?category_name=$1
  16. RewriteRule /author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?author_name=$1&feed=$2
  17. RewriteRule /author/?(.*) /index\.php\?author_name=$1
  18. RewriteRule /rss.xml /wp-feed\.php/\?feed=rss2
  19. RewriteRule /feed/?$ /wp-feed\.php/\?feed=rss2
  20. RewriteRule /comments/feed/?$ /wp-feed\.php/\?feed=comments-rss2
  21. # RewriteRule /([0-9]+)/?([0-9]+)?/?$ /index\.php\?p=$1&page=$2
  22. # RewriteRule /post/([0-9]+)/?([0-9]+)?/?$ /index\.php\?p=$1&page=$2
  23. RewriteRule /post/([0-9]+).html /index\.php\?p=$1
  24. RewriteRule /page/(.*)/?s=(.*) /index\.php\?s=$2&paged=$1
  25. RewriteRule /page/(.*) /index\.php\?paged=$1
  26. 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
  27. RewriteRule /post/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&day=$3&page=$4
  28. RewriteRule /post/date/([0-9]{4})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&page=$3
  29. RewriteRule /post/([0-9]+).html/(feed|rdf|rss|rss2|atom) /index\.php\?feed=rss2&p=$1
  30. RewriteRule /post/([0-9]+).html/trackback /wp-trackback\.php\?p=$1
  31. # # Below is for permalink like /%year%/%monthnum%/%day%/%postname%.html
  32. # # Maybe dumplicate with above!!
  33. # # Provided By 虫虫
  34. # # URL:http://www.lply.org
  35. RewriteRule /tag/(.*) /index\.php\?tag=$1
  36. RewriteRule /(contact|about-copyright|favor|archives|tags|sitemap)/ /index\.php\?pagename=$1
  37. RewriteRule /category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?category_name=$1&feed=$2
  38. RewriteRule /category/?(.*) /index\.php\?category_name=$1
  39. RewriteRule /author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?author_name=$1&feed=$2
  40. RewriteRule /author/?(.*) /index\.php\?author_name=$1
  41. RewriteRule /feed/?$ /wp-feed\.php/\?feed=rss2
  42. RewriteRule /comments/feed/?$ /wp-feed\.php/\?feed=comments-rss2
  43. RewriteRule /page/(.*)/ /index\.php\?paged=$1
  44. 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
  45. RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&day=$3&page=$4
  46. RewriteRule /([0-9]{4})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&page=$3
  47. 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
  48. 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
  49. # # Below is for permalink like /%year%/%monthnum%/%day%/%postname%/
  50. # # Maybe dumplicate with above!!
  51. # # Provided By 虫虫
  52. # # URL:http://www.lply.org
  53. RewriteRule /tag/(.*) /index\.php\?tag=$1
  54. RewriteRule /(contact|about-copyright|favor|archives|tags|sitemap)/ /index\.php\?pagename=$1
  55. RewriteRule /category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?category_name=$1&feed=$2
  56. RewriteRule /category/?(.*)/ /index\.php\?category_name=$1
  57. RewriteRule /author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?author_name=$1&feed=$2
  58. RewriteRule /author/?(.*) /index\.php\?author_name=$1
  59. RewriteRule /feed/?$ /wp-feed\.php/\?feed=rss2
  60. RewriteRule /comments/feed/?$ /wp-feed\.php/\?feed=comments-rss2
  61. RewriteRule /page/(.*)/ /index\.php\?paged=$1
  62. 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
  63. RewriteRule /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&day=$3&page=$4
  64. RewriteRule /([0-9]{4})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&page=$3
  65. 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
  66. 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

  67. # # Below is for permalink like /%postname%.html
  68. # # Maybe dumplicate with above!!
  69. # # Provided By 虫虫
  70. # # URL:http://www.lply.org
  71. RewriteRule /tag/(.*) /index\.php\?tag=$1
  72. RewriteRule /(contact|about-copyright|favor|archives|tags|sitemap)/ /index\.php\?pagename=$1
  73. RewriteRule /category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?category_name=$1&feed=$2
  74. RewriteRule /category/?(.*) /index\.php\?category_name=$1
  75. RewriteRule /author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?author_name=$1&feed=$2
  76. RewriteRule /author/?(.*) /index\.php\?author_name=$1
  77. RewriteRule /feed/?$ /wp-feed\.php/\?feed=rss2
  78. RewriteRule /comments/feed/?$ /wp-feed\.php/\?feed=comments-rss2
  79. RewriteRule /page/(.*)/ /index\.php\?paged=$1
  80. RewriteRule /([^/]+)/?([0-9]+)?.html/?$ /index\.php\?year=$1&monthnum=$2&day=$3&name=$4&page=$5
  81. RewriteRule /?$ /index\.php\?year=$1&monthnum=$2&day=$3&page=$4
  82. RewriteRule /?$ /index\.php\?year=$1&monthnum=$2&page=$3
  83. RewriteRule /([^/]+).html/(feed|rdf|rss|rss2|atom)/?$ /index\.php\?year=$1&monthnum=$2&day=$3&name=$4&feed=$5
  84. RewriteRule /([^/]+).html/trackback/?$ /wp-trackback\.php\?year=$1&monthnum=$2&day=$3&name=$4&tb=1
  85. # # Below is For Discuz!
  86. RewriteRule ^(.*)/archiver/([a-z0-9\-]+\.html)$ $1/archiver/index\.php\?$2
  87. RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html$ $1/forumdisplay\.php\?fid=$2&page=$3
  88. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/viewthread\.php\?tid=$2&extra=page\%3D$4&page=$3
  89. RewriteRule ^(.*)/profile-(username|uid)-(.+)\.html$ $1/viewpro\.php\?$2=$3
  90. RewriteCond Host: (.+)
  91. RewriteCond Referer: (?!http://\1.*).*
  92. RewriteRule .*\.(?:gif|jpg|png) /block.gif
复制代码

4

主题

9

帖子

16

金钱

WP 新手

Rank: 1

积分
28
发表于 2009-11-23 10:34:59 | 显示全部楼层
我的是/%category%/%postname%.html
我觉得挺好滴

15

主题

113

帖子

145

金钱

WP 老手

Rank: 3Rank: 3Rank: 3

积分
247
发表于 2009-11-23 16:20:00 | 显示全部楼层
win主机,建议楼主用404页面转向!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|联系我们|WordPress中文论坛 - CNWP ( 闽ICP备12016335号-11 )

GMT+8, 2019-10-23 12:50 , Processed in 0.111591 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表