title: Forward request to virtual directory to an internal web server using IIS7 URL Rewrite
body: <p>I have an IIS server that is currently only accessible internally to our network and I would like to be able to access some files on it via a folder on our public website.</p>
  
  <p>I would like it to work like the following:</p>
  
  <ul>
  <li><p>user requests <a href="http://www.example-1.com/server2/[filename]" rel="nofollow noreferrer">http://www.example-1.com/server2/[filename]</a> from IIS server 1</p></li>
  <li><p>Server 1 retrieves the file from the internal IIS server 2 at
  <a href="http://www.example2/[filename]" rel="nofollow noreferrer">http://www.example2/[filename]</a></p></li>
  <li><p>Server 1 IIS then sends the file to the user. </p>
  
  <p><em>NOTE: User CANNOT access <a href="http://www.example-2.com/[filename]" rel="nofollow noreferrer">http://www.example-2.com/[filename]</a> directly. Only the first IIS server has access.</em></p></li>
  </ul>
  
  <p>Here is the steps I have taken to do this:</p>
  
  <ol>
  <li>I created a virtual folder in the root of our public website named "server1"</li>
  <li>I then selected URL Rewrite in the IIS manager on this new virtual folder</li>
  <li>I then created the rule as shown below:</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/LPZb3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LPZb3.png" alt="enter image description here"></a></p>
  
  <p>I am currently recieveing a 404 error when I try to access a file at:
  <a href="http://www.example-1.com/server2/test.jpg" rel="nofollow noreferrer">http://www.example-1.com/server2/test.jpg</a></p>
  
  <p>I can verify the file is there by remoteing into web server one and browsing to:
  <a href="http://www.example-2/test.jpg" rel="nofollow noreferrer">http://www.example-2/test.jpg</a>
  This shows the test image.</p>
  
  <p>I feel the problem must somehow be related to my URL rewrite rule.</p>
  
  <p>If someone could offer advice on this issue I would greatly appreciate it as I have never used the URL Rewrite module before.
  Thank you!</p>