IIS6+ ISAPI 3.x 指定文件不处理的伪静态设置
今天在设置IIS网站伪静态的时候,发现 设置完.htaccess后,正常的HTML静态页面访问成空白的了,折腾了很长时间以为是网站出了问题,各种调试后没用,停止了伪静态规则恢复正常,那就是规则上出现问题了,可以将正常的HTML页,在规则中设置一下。(注意,这些规则要加在前面,否则没用,可能还有其他设置方法)
以下是ZBLOG的伪静态规则,可以参考下
#ISAPI Rewrite 3
RewriteBase /blog/
RewriteRule index.html /index.html [L]
RewriteRule directions.html /directions.html [L]
RewriteRule faq.html /faq.html [L]
RewriteRule ^default_([0-9]+)\.html$ catalog.asp\?page=$1
RewriteRule ^category-([0-9]+)_([0-9]+).html$ catalog.asp\?cate=$1&page=$2 [NU]
RewriteRule ^category-([0-9]+).html$ catalog.asp\?cate=$1 [NU]
RewriteRule ^author-([0-9]+)_([0-9]+).html$ catalog.asp\?auth=$1&page=$2 [NU]
RewriteRule ^author-([0-9]+).html$ catalog.asp\?auth=$1 [NU]
RewriteRule ^tags-([0-9]+)_([0-9]+).html$ catalog.asp\?tags=$1&page=$2 [NU]
RewriteRule ^tags-([0-9]+).html$ catalog.asp\?tags=$1 [NU]
RewriteRule ^date-([0-9\-]+)_([0-9]+).html$ catalog.asp\?date=$1&page=$2 [NU]
RewriteRule ^date-([0-9\-]+).html$ catalog.asp\?date=$1 [NU]
RewriteRule ^post/(?!zb_)(.*).html$ view.asp\?id=$1 [NU]
RewriteRule ^search.html$ search.asp [NU]
RewriteRule ^feed.html$ feed.asp [NU]
RewriteRule ^(?!zb_)(.*).html$ view.asp\?id=$1 [NU]