.htaccess ISAPI重写转换

.htaccess ISAPI重写转换,.htaccess,url-rewriting,isapi,.htaccess,Url Rewriting,Isapi,我有一个通过.htaccess文件使用ISAPI重写的现有站点。我正在移动到Windows服务器上的新主机,并被告知必须将我的规则加载到web.config文件中 所以旧规则是这样的: RewriteBase / RewriteMap mapfileNews txt:mapfile/mapfileNews.txt RewriteCond %{QUERY_STRING} ^ArticleID=[^&]+&n=(.+) RewriteRule ^pages/ndetail\.asp$

我有一个通过.htaccess文件使用ISAPI重写的现有站点。我正在移动到Windows服务器上的新主机,并被告知必须将我的规则加载到web.config文件中

所以旧规则是这样的:

RewriteBase /
RewriteMap mapfileNews txt:mapfile/mapfileNews.txt
RewriteCond %{QUERY_STRING} ^ArticleID=[^&]+&n=(.+)
RewriteRule ^pages/ndetail\.asp$ news/%1? [NC,R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^news/([^/]+)$ pages/ndetail.asp?
ArticleID=${mapfileNews:$1}&n=$1 [NC,L]
因此,规则所做的是打开mapfileNews.txt文件,获取ID号并将其映射到文章名。比如:

被改写成

我不知道如何转换它,使其在我的web.config文件中工作

请原谅我的无礼。我一点也不是泰奇:(