title: web.config - Ignore rewrite for specific folder
body: <p>The root is a WordPress site. I need to ignore URL rewrite for a folder "app", as I hosted a virtual directory .NET App on that folder.</p>
  
  <pre><code>http://www.mywebsite.com/app
  </code></pre>
  
  <p>URL Rewrite rules in web.config works partially. If the URL link to a static file or folder in the .NET app, it works. If the URL link to a routed url, it fails. How to fix?</p>
  
  <p>For example this URL:</p>
  
  <pre><code>mywebsite.com/app/Login
  </code></pre>
  
  <p>shoud be routed to </p>
  
  <pre><code>mywebsite.com/app/Login.aspx
  </code></pre>
  
  <p>but, it is captured by WordPress and display a 404 not found error.</p>
  
  <p>if the URL is entered as this, then it runs ok:</p>
  
  <pre><code>mywebsite.com/app/Login.aspx
  </code></pre>
  
  <p>Here is the web.config at root site (wordpress)</p>
  
  <pre><code>&lt;rule name="WordPress: http://www.mywebsite.com" patternSyntax="Wildcard"&gt;
  &lt;match url="*"/&gt;
  &lt;conditions&gt;
  &lt;add input="{R:0}" pattern="^/app" negate="true" /&gt;
  &lt;add input="{R:0}" pattern="^/app/(.*)$" negate="true" /&gt;
  &lt;add input="{R:0}" pattern="^app/(.*)$" negate="true" /&gt;
  &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/&gt;
  &lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/&gt;
  &lt;/conditions&gt;
  &lt;action type="Rewrite" url="index.php"/&gt;
  &lt;/rule&gt;
  </code></pre>
  
  <p>This is the code for URL routing in the .NET App</p>
  
  <pre><code>public class Global : System.Web.HttpApplication
  {
      protected void Application_Start(object sender, EventArgs e)
      {
          RouteTable.Routes.MapPageRoute("login", "login", "~/login.aspx");
      }
  }
  </code></pre>