title: .htaccess to web.config for url rewrite and redirection
body: <p>I have domain xyz.com which is hosted on Windows server.</p>
  
  <p>Code for xyz.com is written in PHP (previously it was in ASP.NET). Database is MySQL (previously it was in SQL server).</p>
  
  <p>Now after re-developing whole website in PHP I came to know that <code>.htaccess</code> will not work on Windows server. I have to play with <code>web.config</code>.</p>
  
  <p>Here is <code>.htaccess</code> code I have used when I was redeveloping website in PHP locally:</p>
  
  <pre class="lang-bash prettyprint-override"><code>RewriteRule index.html index.php
  
  RewriteRule news.html news.php
  RewriteRule search-results.html search-results.php
  
  RewriteRule ^([A-Za-z0-9_\-]+).html$ pages.php?pageid=$1&amp;%{QUERY_STRING} [ne]
  </code></pre>
  
  <p>One weird thing happening</p>
  
  <p>when i add below line of code in web.config it is working perfectly</p>
  
  <pre><code>    &lt;rules&gt;
                  &lt;clear /&gt;
                  &lt;rule name="Redirect to google.com" stopProcessing="true"&gt;
                      &lt;match url="^google$" /&gt;
                      &lt;action type="Redirect" url="http://www.google.com/" appendQueryString="false" /&gt;
                  &lt;/rule&gt;
  &lt;/rules&gt;
  </code></pre>
  
  <p>above code redirecting me to google.com, it means that rewrite module is already enabled</p>
  
  <p>but when i add code mentioned below to web.config</p>
  
  <pre><code> &lt;rules&gt;
              &lt;rule name="REWRITE_TO_PHP"&gt;
              &lt;match url="^(.+).html$" /&gt;
                  &lt;conditions logicalGrouping="MatchAll" /&gt;
                  &lt;action type="Rewrite" url="pages.php?pageid={R:1}" /&gt;
              &lt;/rule&gt;
  </code></pre>
  
  <p>it is giving me error : </p>
  
  <p><strong>HTTP Error 500.19 - Internal Server Error
  The requested page cannot be accessed because the related configuration data for the page is invalid.</strong></p>
  
  <p>Can anyone help me with creating equivalent <code>web.config</code> code?</p>