title: Rewrite rule conversion to web.config
body: <p>Could anyone tell me how what the conversion of the below rewrite would be for a web.config file?</p>
  
  <pre><code>RewriteEngine On
  RewriteRule ^/(credits|content)/?$ switch.php?view=$1
  </code></pre>
  
  <p>Or if there is any online conversion tool that would be great.</p>
  
  <p>Thanks</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>For example:</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
  </code></pre>
  
  <p>Would be: </p>
  
  <pre><code>&lt;rewrite&gt;
    &lt;rules&gt;
      &lt;rule name="Imported Rule 1" stopProcessing="true"&gt;
        &lt;match url="^(.*)$" ignoreCase="false" /&gt;
        &lt;conditions&gt;
          &lt;add input="{HTTP_HOST}" pattern="^example\.com$" /&gt;
        &lt;/conditions&gt;
        &lt;action type="Redirect" redirectType="Permanent" url="http://www.example.com/{R:1}" /&gt;
      &lt;/rule&gt;
    &lt;/rules&gt;
  &lt;/rewrite&gt;
  </code></pre>