title: Redirect from one directory to another with mod_rewrite
body: <p>The following is my directory structures:</p>
  
  <pre><code>admin\
  controls\
  images\
  media\
  lib\
  models\
  views\
  index.php
  .htaccess
  </code></pre>
  
  <p>The following is my .htaccess</p>
  
  <pre><code>RewriteEngine On 
  RewriteRule /admin/images/(.*) /images/$1
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php
  </code></pre>
  
  <p>I want everything in /admin/images be equal to /images in root directory. For example: <a href="http://www.example.com/admin/images/example.png">http://www.example.com/admin/images/example.png</a> will be the same as <a href="http://www.example.com/images/example.png">http://www.example.com/images/example.png</a></p>
  
  <p><strong>Problem with my .htaccess is:</strong>
  It goes to index.php instead of mirroring admin/images to images/</p>
  
  <hr>
  
  <p><strong>Solution</strong></p>
  
  <pre><code>RewriteEngine On 
  RewriteRule /admin/images/(.*) /images/$1 [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php
  </code></pre>