首页 > 伪静态

windows平台虚拟主机实现伪静态(URL Rewrite)的流程:进入虚拟主机控制面板,点“ISAPI筛选器 ”,点击“开启自定义的URL静态化支持”,再修改/others/discuz/httpd.conf 在里面添加您自己的规则即可。

注意,所有规则放在一起可能会有冲突,只放置你需要的规则即可。

  1. #shopex4.8    
  2. RewriteBase /   
  3. RewriteCond %{REQUEST_FILENAME} \.(html|htm|php|php2|php3|php4|php5|phtml|pwml|inc|asp|aspx|ascx|jsp|cfm|cfc|pl|cgi|shtml|shtm|phtm|xml)$   
  4. RewriteCond %{REQUEST_FILENAME} !-f   
  5. RewriteCond %{REQUEST_FILENAME} !-d   
  6. RewriteRule ^(?!shopadmin)(.*)$ index.php?$1 [L,QSA]   
  7.   
  8. #shopex4.72  
  9. RewriteRule /index.html /index.php   
  10. RewriteRule /default.html /index.php   
  11. RewriteRule /bulletin.html /index.php?gOo=article_list.dwt&acat=1  
  12. RewriteRule /bulletin_([0-9]+).html /index.php?gOo=article_list.dwt&acat=1&p=$1  
  13. RewriteRule /catalog.html /index.php?gOo=goods_category.dwt   
  14. RewriteRule /list.html /index.php?gOo=goods_search_list.dwt   
  15. RewriteRule /list_([0-9]+).html /index.php?gOo=goods_search_list.dwt&p=$1  
  16. RewriteRule /member.html /index.php?gOo=member_home.dwt   
  17. RewriteRule /faq.html /index.php?gOo=help.dwt&acat=2  
  18. RewriteRule /faq_([0-9]+).html /index.php?gOo=help.dwt&acat=2&p=$1  
  19. RewriteRule /safe.html /index.php?gOo=help_safe.dwt   
  20. RewriteRule /howtobuy.html /index.php?gOo=help_buystep.dwt   
  21. RewriteRule /howtopay.html /index.php?gOo=help_send.dwt   
  22. RewriteRule /contactus.html /index.php?gOo=help_contact.dwt   
  23. RewriteRule /aboutus.html /index.php?gOo=help_copyright.dwt   
  24. RewriteRule /feedback.html /index.php?gOo=shopbbs.dwt   
  25. RewriteRule /feedback_([0-9]+).html /index.php?gOo=shopbbs.dwt&p=$1  
  26. RewriteRule /friendlink.html /index.php?gOo=linkmore.dwt   
  27. RewriteRule /register.html /index.php?gOo=register_1.dwt   
  28. RewriteRule /lostpass.html /index.php?gOo=forget.dwt   
  29. RewriteRule /product/([0-9]+).html /index.php?gOo=goods_details.dwt&goodsid=$1    
  30. RewriteRule /product_([0-9]+).html /index.php?gOo=goods_details.dwt&goodsid=$1    
  31. RewriteRule /([0-9]+)_([^.]*).html /index.php?gOo=goods_details.dwt&goodsid=$1    
  32. RewriteRule /article_([0-9]+).html /index.php?gOo=help_details.dwt&articleid=$1    
  33. RewriteRule /message_([0-9]+).html /index.php?gOo=article_details.dwt&articleid=$1    
  34. RewriteRule /catalog_([0-9]+).html /index.php?gOo=goods_search_list.dwt&gcat=$1    
  35. RewriteRule /catalog_([0-9]+)_([0-9]+).html /index.php?gOo=goods_search_list.dwt&gcat=$1&p=$2    
  36. RewriteRule /addtofavorites_([0-9]+).html /index.php?gOo=addmembergoods.do&goodsid=$1    
  37. RewriteRule /list_([a-zA-Z]+).html /index.php?gOo=goods_search_list.dwt&gtype=$1    
  38. RewriteRule /list_([a-zA-Z]+)_([0-9]+).html /index.php?gOo=goods_search_list.dwt&gtype=$1&p=$2  
  39.   
  40. #ecshop   
  41. RewriteRule ^(.*)/index.html$                $1/index\.php          [I]   
  42. RewriteRule ^(.*)/category$                  $1/index\.php          [I]   
  43. RewriteRule ^(.*)/feed-c([0-9]+).xml$        $1/feed\.php\?cat=$2    [I]   
  44. RewriteRule ^(.*)/feed-b([0-9]+).xml$        $1/feed\.php\?brand=$2  [I]   
  45. RewriteRule ^(.*)/feed.xml$                  $1/feed\.php           [I]   
  46. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$  $1/category\.php\?id=$2&brand=$3&price_min=$4&price_max=$5&filter_attr=$6&page=$7&sort=$8&order=$9 [I]   
  47. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)\.html$                            $1/category\.php\?id=$2&brand=$3&price_min=$4&price_max=$5&filter_attr=$6                          [I]   
  48. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$                              $1/category\.php\?id=$2&brand=$3&page=$4&sort=$5&order=$6                                          [I]   
  49. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$                                       $1/category\.php\?id=$2&brand=$3&page=$4                                                           [I]   
  50. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)(.*)\.html$                                            $1/category\.php\?id=$2&brand=$3                                                                   [I]   
  51. RewriteRule ^(.*)/category-([0-9]+)(.*)\.html$                               $1/category\.php\?id=$2                              [I]   
  52. RewriteRule ^(.*)/category-([0-9]+)-b([0-9]+)\.html(.*)$                                            $1/category\.php\?$4&id=$2&brand=$3  
  53. RewriteRule ^(.*)/goods-([0-9]+)(.*)\.html$                                  $1/goods\.php\?id=$2                                 [I]   
  54. RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$  $1/article_cat\.php\?id=$2&page=$3&sort=$4&order=$5  [I]   
  55. RewriteRule ^(.*)/article_cat-([0-9]+)-([0-9]+)(.*)\.html$                   $1/article_cat\.php\?id=$2&page=$3                   [I]   
  56. RewriteRule ^(.*)/article_cat-([0-9]+)(.*)\.html$                            $1/article_cat\.php\?id=$2                           [I]   
  57. RewriteRule ^(.*)/article-([0-9]+)(.*)\.html$                                $1/article\.php\?id=$2                               [I]   
  58. RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.html   $1/brand\.php\?id=$2&cat=$3&page=$4&sort=$5&order=$6 [I]   
  59. RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html                $1/brand\.php\?id=$2&cat=$3&page=$4                  [I]   
  60. RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)\.html(.*)$                        $1/brand\.php\?$4&id=$2&cat=$3                  [I]   
  61. RewriteRule ^(.*)/brand-([0-9]+)-c([0-9]+)(.*)\.html                         $1/brand\.php\?id=$2&cat=$3                          [I]   
  62. RewriteRule ^(.*)/brand-([0-9]+)(.*)\.html                                   $1/brand\.php\?id=$2                                 [I]   
  63. RewriteRule ^(.*)/tag-(.*)\.html                                             $1/search\.php\?keywords=$2                          [I]   
  64. RewriteRule ^(.*)/snatch-([0-9]+)\.html$                                     $1/snatch\.php\?id=$2                                [I]   
  65. RewriteRule ^(.*)/group_buy-([0-9]+)\.html$                                  $1/group_buy\.php\?act=view&id=$2                    [I]   
  66. RewriteRule ^(.*)/auction-([0-9]+)\.html$                                    $1/auction\.php\?act=view&id=$2                      [I]   
  67. RewriteRule ^(.*)/exchange-id([0-9]+)(.*)\.html$                             $1/exchange\.php\?id=$2&act=view                     [I]   
  68. RewriteRule ^(.*)/exchange-([0-9]+)-min([0-9]+)-max([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$ $1/exchange\.php\?cat_id=$2&integral_min=$3&integral_max=$4&page=$5&sort=$6&order=$7 [I]   
  69. RewriteRule ^(.*)/exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$                         $1/exchange\.php\?cat_id=$2&page=$3&sort=$4&order=$5 [I]   
  70. RewriteRule ^(.*)/exchange-([0-9]+)-([0-9]+)(.*)\.html$                                          $1/exchange\.php\?cat_id=$2&page=$3  [I]   
  71. RewriteRule ^(.*)/exchange-([0-9]+)(.*)\.html$                                                   $1/exchange\.php\?cat_id=$2  [I]   
  72.   
  73. #phpwind 跟shopex4.85的规则有冲突! #是注释符号,默认没启用phpwind的规则的。   
  74. #RewriteRule ^(.*)-htm-(.*)$ $1.php?$2  
  75. #RewriteRule ^(.*)simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2  
  76.   
  77. #discuz 老版本规则   
  78. RewriteRule ^(.*)/archiver/([a-z0-9\-]+\.html)$ $1/archiver/index\.php\?$2  
  79. RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html$ $1/forumdisplay\.php\?fid=$2&page=$3  
  80. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/viewthread\.php\?tid=$2&extra=page\%3D$4&page=$3  
  81. RewriteRule ^(.*)/profile-(username|uid)-(.+)\.html$ $1/viewpro\.php\?$2=$3  
  82. RewriteRule ^(.*)-htm-(.*)$ $1.php?$2  
  83. RewriteRule ^(.*)simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2  
  84. RewriteRule ^(.*)/archiver/((fid|tid)-[\w\-]+\.html)\?*(.*)$ $1/archiver/index\.php\?$2&$4  
  85. RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forumdisplay\.php\?fid=$2&page=$3&$4  
  86. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/viewthread\.php\?tid=$2&extra=page\%3D$4&page=$3&$4  
  87. RewriteRule ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$ $1/space\.php\?$2=$3&$4  
  88. RewriteRule ^(.*)/tag-(.+)\.html\?*(.*)$ $1/tag\.php\?name=$2&$3  
  89.   
  90. #Discuz!x和discuz x1.5伪静态规则   
  91. RewriteRule ^(.*)/topic-(.+)\.html\?*(.*)$ $1/portal\.php\?mod=topic&topic=$2&$3  
  92. RewriteRule ^(.*)/article-([0-9]+)\.html\?*(.*)$ $1/portal\.php\?mod=article&articleid=$2&$3  
  93. RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$3&$4  
  94. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$5  
  95. RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=group&fid=$2&page=$3&$4  
  96. RewriteRule ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$ $1/home\.php\?mod=space&$2=$3&$4  
  97. RewriteRule ^(.*)/([a-z]+)-(.+)\.html\?*(.*)$ $1/$2\.php\?rewrite=$3&$4  
  98.   
  99. #discuz——-supsite/x-space   
  100. RewriteRule ^(.*)/archiver/([a-z0-9\-]+\.html)$ $1/archiver/index\.php\?$2  
  101. RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html$ $1/forumdisplay\.php\?fid=$2&page=$3  
  102. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/viewthread\.php\?tid=$2&extra=page\%3D$4&page=$3  
  103. RewriteRule ^(.*)/profile-(username|uid)-(.+)\.html$ $1/viewpro\.php\?$2=$3  
  104. RewriteRule ^(.*)-htm-(.*)$ $1.php?$2  
  105. RewriteRule ^(.*)simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2  
  106.   
  107.     
  108.   
  109. #Start dznt URL Rewrite (discuz NT)   
  110.   
  111.     RewriteRule ^(.*)/userinfo-([0-9]+)\.html$  $1/userinfo.aspx?userid=$2  
  112.     RewriteRule ^(.*)/showforum-([0-9]+)\.html$  $1/showforum.aspx?forumid=$2  
  113.     RewriteRule ^(.*)/showtopic-([0-9]+)\.html$  $1/showtopic.aspx?topicid=$2  
  114.     RewriteRule ^(.*)/showforum-([0-9]+)-([0-9]+)\.html$  $1/showforum.aspx?forumid=$2&page=$3  
  115.     RewriteRule ^(.*)/showtopic-([0-9]+)-([0-9]+)\.html$  $1/showtopic.aspx?topicid=$2&page=$3  
  116.     RewriteRule ^(.*)/archiver/showforum-([0-9]+)\.html$  $1/archiver/showforum.aspx?forumid=$2  
  117.     RewriteRule ^(.*)/archiver/showtopic-([0-9]+)\.html$  $1/archiver/showtopic.aspx?topicid=$2  
  118.     RewriteRule ^(.*)/archiver/showtopic-([0-9]+)-([0-9]+)\.html$  $1/archiver/showtopic.aspx?topicid=$2&page=$3  
  119.     RewriteRule ^(.*)/archiver/showforum-([0-9]+)-([0-9]+)\.html$  $1/archiver/showforum.aspx?forumid=$2&page=$3  
  120.     RewriteRule ^(.*)/tools/rss-([0-9]+)\.html$  $1/tools/rss.aspx?forumid=$2  
  121.     RewriteRule ^(.*)/tools/spacerss-([0-9]+)\.html$  $1/tools/rss.aspx?uid=$2&type=space   
  122.     RewriteRule ^(.*)/tools/photorss-([0-9]+)\.html$  $1/tools/rss.aspx?uid=$2&type=photo   
  123.     RewriteRule ^(.*)/space\/((\w|\s)+)((\/?))?$  $1/space/index.aspx?user=$2  
  124.     RewriteRule ^(.*)/space\/((\w|\s|-)+)((\/?))?\?((.*)+)$  $1/space/index.aspx?user=$2&$6  
  125.   
  126.     RewriteRule ^(.*)/showdebate-([0-9]+)\.html$  $1/showdebate.aspx?topicid=$2  
  127.     RewriteRule ^(.*)/showbonus-([0-9]+)\.html$  $1/showbonus.aspx?topicid=$2  
  128.   
  129.     RewriteRule ^(.*)/postgoods-(\d+)*.html$  $1/postgoods.aspx?categoryid=$2  
  130.     RewriteRule ^(.*)/showgoodslist-(\d+)(-(\d+))?.html$  $1/showgoodslist.aspx?categoryid=$2&page=$4  
  131.     RewriteRule ^(.*)/showgoods-(\d+)*.html$  $1/showgoods.aspx?goodsid=$2  
  132.   
  133. #End dznt URL Rewrite settings   
  134.   
  135. #Start dvphp URL Rewrite settings   
  136.   
  137.     RewriteRule ^(.*?\/)(?:forum)-([-0-9]+)\/?$ $1index.php?__is_iis_rewrite=1&__rewrite_arg=$2  
  138.     RewriteRule ^(.*?\/)(?:board)-([-0-9]+)\/?$ $1dispbbs.php?__is_iis_rewrite=1&__rewrite_arg=$2  
  139.     RewriteRule ^(.*?\/)([_a-zA-Z]+)-([-0-9]+)\/?$ $1$2.php?__is_iis_rewrite=1&__rewrite_arg=$3  
  140.     RewriteRule ^(.*?(?:index|dv_forum|dispbbs))-([-0-9]+)\.html$ $1.php?__is_iis_rewrite=1&__rewrite_arg=$2  
  141. #End dvphp URL Rewrite settings   
  142.   
  143. #uchome   
  144. RewriteRule ^(.*)/(space|network)-(.+)\.html$ $1/$2\.php\?rewrite=$3 [L]   
  145. RewriteRule ^(.*)/(space|network)\.html$ $1/$2\.php [L]   
  146. RewriteRule ^(.*)/([0-9]+)$ $1/space\.php\?uid=$2 [L]   
  147. RewriteRule ^(.*)/archiver/((fid|tid)-[0-9]+\.html)\?*(.*)$ $1/archiver/index\.php\?$2&$4  
  148. #end uchome   
  149.   
  150. #dzx2.0  apache和iis通用(apache需去除[NU]参数)   
  151. RewriteEngine On   
  152. RewriteCond %{QUERY_STRING} ^(.*)$   
  153. RewriteRule ^(.*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2&%1  
  154. RewriteCond %{QUERY_STRING} ^(.*)$   
  155. RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3&%1  
  156. RewriteCond %{QUERY_STRING} ^(.*)$   
  157. RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3&%1  
  158. RewriteCond %{QUERY_STRING} ^(.*)$   
  159. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&%1  
  160. RewriteCond %{QUERY_STRING} ^(.*)$   
  161. RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3&%1  
  162. RewriteCond %{QUERY_STRING} ^(.*)$   
  163. RewriteRule ^(.*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3&%1 [NU]   
  164. RewriteCond %{QUERY_STRING} ^(.*)$   
  165. RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3&%1  
  166. RewriteCond %{QUERY_STRING} ^(.*)$   
  167. RewriteRule ^(.*)/(fid|tid)-([0-9]+)\.html$ $1/index.php?action=$2&value=$3&%1  
  168.   
  169. #dzx2.5 apache和iis通用(apache需去除[NU]参数)   
  170. RewriteEngine On   
  171. RewriteBase /   
  172. RewriteCond %{QUERY_STRING} ^(.*)$   
  173. RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topicid=$1&%1  
  174. RewriteCond %{QUERY_STRING} ^(.*)$   
  175. RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1  
  176. RewriteCond %{QUERY_STRING} ^(.*)$   
  177. RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1  
  178. RewriteCond %{QUERY_STRING} ^(.*)$   
  179. RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1  
  180. RewriteCond %{QUERY_STRING} ^(.*)$   
  181. RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1  
  182. RewriteCond %{QUERY_STRING} ^(.*)$   
  183. RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1 [NU]   
  184. RewriteCond %{QUERY_STRING} ^(.*)$   
  185. RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1  
  186. RewriteCond %{QUERY_STRING} ^(.*)$   
  187. RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1  
  188. RewriteCond %{QUERY_STRING} ^(.*)$   
  189. RewriteRule ^([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ plugin.php?id=$1:$2&%1  
  190.   
  191.     
  192.   
  193. #dzx3.0 apache和iis通用(apache需去除[NU]参数)   
  194. RewriteEngine On   
  195. RewriteBase /   
  196. RewriteCond %{QUERY_STRING} ^(.*)$   
  197. RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1  
  198. RewriteCond %{QUERY_STRING} ^(.*)$   
  199. RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1  
  200. RewriteCond %{QUERY_STRING} ^(.*)$   
  201. RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1  
  202. RewriteCond %{QUERY_STRING} ^(.*)$   
  203. RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1  
  204. RewriteCond %{QUERY_STRING} ^(.*)$   
  205. RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1  
  206. RewriteCond %{QUERY_STRING} ^(.*)$   
  207. RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1 [NU]   
  208. RewriteCond %{QUERY_STRING} ^(.*)$   
  209. RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1  
  210. RewriteCond %{QUERY_STRING} ^(.*)$   
  211. RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1  
  212. RewriteCond %{QUERY_STRING} ^(.*)$   
  213. RewriteRule ^([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ plugin.php?id=$1:$2&%1  
  214.