title: .htaccess rewrite from subdirectory to root
body: <p>I have some difficulties with the mod_rewrite rules.
  I want to rewrite any request on</p>
  
  <pre><code>www.example.com/dev/*
  </code></pre>
  
  <p>to </p>
  
  <pre><code>www.example.com/*
  </code></pre>
  
  <p>For example when the request url is <code>www.example.com/dev/index.php</code>, the response should be <code>www.example.com/dev/index.php</code>, and not just that the url looks like it's from the root directory, but it is actually using the <code>index.php</code> from root directory.</p>
  
  <p>I have tried the mod_alias which works</p>
  
  <pre><code>RedirectMatch (^/dev/)(.*) http://www.example.com/$2
  </code></pre>
  
  <p>But it is not possible to apply ip address conditions with mod_alias, so I still need a solution with mod_rewrite.</p>
  
  <p>Would anyone share some knowledge please? Thanks.</p>