重写条件以排除目录IIS

重写条件以排除目录IIS,iis,mod-rewrite,rewrite,Iis,Mod Rewrite,Rewrite,我的.htaccess文件中有以下规则 RewriteEngine On RewriteCond %{REQUEST_URI} ^/admin/ RewriteRule !\.(js|ico|gif|jpg|jpeg|bmp|png|swf|css|html|htm|php|rar|xml|ani|cur|mp3|mp4|flv|tpl|inc)$ /admin/index.php [L,NC] RewriteCond %{REQUEST_URI} !^/admin/ RewriteRule

我的
.htaccess
文件中有以下规则

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/admin/
RewriteRule !\.(js|ico|gif|jpg|jpeg|bmp|png|swf|css|html|htm|php|rar|xml|ani|cur|mp3|mp4|flv|tpl|inc)$ /admin/index.php [L,NC]

RewriteCond %{REQUEST_URI} !^/admin/
RewriteRule !\.(js|ico|gif|jpg|jpeg|bmp|png|swf|css|html|htm|php|rar|xml|ani|cur|mp3|mp4|flv|tpl|inc|doc|exe|zip)$ index.php [L,NC]
我想为IIs更改它,如何更改

[ISAPI_Rewrite]
RewriteEngine On

RewriteCond %{REQUEST_URI} !(/admin/.*) [NC]
RewriteRule ^[\w/\%]*(?:\.(?!(?:js|ico|gif|jpg|jpeg|bmp|png|swf|css|html|htm|php|rar|xml|ani|cur|mp3|mp4|flv|tpl|inc|doc|exe|zip|txt)$)[\w\%]*$)? /index.php [I]

RewriteCond %{REQUEST_URI} (/admin/.*) [NC]
RewriteRule ^[\w/\%]*(?:\.(?!(?:js|ico|gif|jpg|jpeg|bmp|png|swf|css|html|htm|php|rar|xml|ani|cur|mp3|mp4|flv|tpl|inc|doc|exe|zip|txt)$)[\w\%]*$)? /admin/index.php [I]

我改变了你文章的格式,使它更容易阅读。仍然不清楚,你在问什么:你是否用
ISAPI\u Rewrite
尝试了第二个代码,但没有成功?(本例中的错误是什么)。或者您想知道,是否有更好的IIS方法?你可能需要澄清你的问题才能在这里得到答案。我想他是在问Apache上的mod_rewrite和Windows上的ISAPI rewrite在他给定的规则集上的语法差异。