IIS Url rewrite does not work -


i have problem iis rewrite module. googled , search problem stil exists.

i have 2 rewrite rules, first 1 redirect http request https equivalant , second 1 redirect specific pages other page.

the http requests redirects https second rule not work properly.

<rewrite>   <rules>           <rule name="redirect special page" stopprocessing="true">       <match url="(.*)mysite.com/accounttransactions" />       <action type="redirect" url="mysite.com/404.html" />     </rule>     <rule name="http https redirect" stopprocessing="true">       <match url="(.*)" />       <conditions>         <add input="{https}" pattern="off" ignorecase="true" />       </conditions>       <action type="redirect" redirecttype="found" url="https://{http_host}/{r:1}" />     </rule>   </rules> </rewrite> 

i'm using iis 8, windows server 2012 r2.

what's wrong ?

the match url should not contain domain name, path

<match url="^accounttransactions" /> 

see http://www.iis.net/learn/extensions/url-rewrite-module/url-rewrite-module-configuration-reference

if need match path under specific domain (when site has multiple domain names) should add condition {http_host}

<conditions>    <add input="{http_host}" type="pattern" pattern="^www\.mysite\.com$">  </conditions>