apache rewrite 转 iis web.config

apache rewrite 转 iis web.config

1) ^(.*)/ 替换为 ^ ,
2) $1/ 删除
3) . ? 去掉前面的 \
4) $N 更换为 $N-1 ,从大到小换!!!

例子

RewriteRule ^(.*)/read_([0-9]+)/([0-9]+).html$ $1/modules/article/reader.php\?aid=$2&cid=$3
需要改为
RewriteRule ^read_([0-9]+)/([0-9]+).html$ modules/article/reader.php?aid=$1&cid=$2

web.config 就可以是

借用工具

https://www.toolnb.com/tools/rewriteTools.html