title: URL Rewrite Pattern to exclude application name from path
body: <p>I'm trying to use the IIS 7 URL Rewrite feature for the first time, and I'm having trouble getting my regular expression working. It seems like it should be simple enough. All I need to do is rewrite a URL like this:</p>
  
  <pre><code>http://localhost/myApplication/MySpecialFolder
  </code></pre>
  
  <p>To:</p>
  
  <pre><code>http://localhost/MySpecialFolder
  </code></pre>
  
  <p>Is this possible? I want the regular expression to ignore everything before "myApplication" in the original URL, so that I could use "http://localhost" OR "http://mysite", etc.</p>
  
  <p>Here's what I've got so far:</p>
  
  <pre><code>^myApplication/MySpecialFolder$
  </code></pre>
  
  <p>But using the "Test Pattern..." feature in IIS, it says my patterns don't match unless I supply "myApplication/MySpecialFolder" exactly. Does anyone know how I can update my regular expression so that everything prior to "myApplication" is ignored and the following URLs will be seen as a match?</p>
  
  <pre><code>http://localhost/myApplication/MySpecialFolder
  http://mysite/myApplication/MySpecialFolder
  </code></pre>
  
  <p>Many thanks in advance!</p>
  
  <p><strong>SOLUTION:</strong></p>
  
  <p>I needed to change my regex to:</p>
  
  <pre><code>myApplication/MySpecialFolder
  </code></pre>
  
  <p>Without the <code>^</code> at the beginning and without the <code>$</code> at the end.</p>