title: Tunnel a localhost subdirectory through ngrok?
body: <p>Objective: want to share a website preview using ngrok, which creates a tunnel from which my localhost can be seen with an url of something like <code>mywebsite.ngrok.io</code></p>
  
  <p>Problem: I use WAMP and my localhost folder looks something like this:</p>
  
  <pre><code>localhostdirectory
     |-- website1
     |-- website2
     |-- etc
  </code></pre>
  
  <p>To access a website I type to <code>localhost/website1/</code> in the browser, I would like to tunnel only that URL, the possible solutions would be:</p>
  
  <ol>
  <li><p>Setting up a Virtual host, <a href="http://forum.wampserver.com/read.php?2,127757" rel="noreferrer">I would go through the hassle of manually setting up a virtual host</a>, then I get something like website1.dev, and then I would pass it to ngrok as the host header in the HTTP request, <a href="https://ngrok.com/docs#host-header" rel="noreferrer">like that</a>:</p>
  
  <pre><code>ngrok http -host-header=website1.dev 80
  </code></pre>
  
  <p>I didn't understand what the host header is though, and why can't I pass a relative url like <code>localhost/website1/</code>, also what is the rewrite option?</p></li>
  <li>Change the folder directory of my localhost to the folder of the website, I would prefer not to do that.</li>
  </ol>
  
  <p>Is there a better way to accomplish my objective in an easier way, maybe going through WAMP aliases? </p>