Apache对iis重写规则

我正在尝试将Apache的网站移动到iis 8.5

一切正常,但1规则failes我的网站正常运行

RewriteCond %{REQUEST_URI} !\.(js|css|jpg|jpeg|gif|png)$ [or] RewriteCond %{REQUEST_URI} apple-touch-icon\.png$ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php [L,QSA] 

有人可以把它翻译成IIS重写

我find了一些例子来做到这一点

 <rule name="Webasyst Controller" stopProcessing="true"> <match url="^(.*)$" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> <add input="{URL}" pattern="!\.(eot|ttf|woff|js|css|jpg|jpeg|gif|png)$" negate="true" /> <add input="{URL}" pattern="apple-touch-icon\.png$" negate="true" /> </conditions> <action type="Rewrite" url="index.php" appendQueryString="true" /> </rule> 

 <rule name="Webasyst Controller" stopProcessing="true"> <match url="[^eot|ttf|woff|js|css|jpg|jpeg|gif|png]$|apple\-touch\-icon\.png$" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="index.php" appendQueryString="true" /> </rule> 

他们两个都不工作

有人可以帮忙吗?

基于你的问题中的第二个例子:

 <rule name="Webasyst Controller" stopProcessing="true"> <match url="(\.(?!eot|ttf|woff|js|css|jpe?g|gif|png)|apple\-touch\-icon\.png)$" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="index.php" appendQueryString="true" /> </rule>