title: How to exclude a specific folder in htaccess
body: <p>When user hits </p>
  
  <ul>
  <li><a href="http://localhost/mywebsite/folder1" rel="nofollow">http://localhost/mywebsite/folder1</a> </li>
  </ul>
  
  <p>this link my htaccess is working.</p>
  
  <p>But when user hits </p>
  
  <ul>
  <li><a href="http://localhost/mywebsite/folder2" rel="nofollow">http://localhost/mywebsite/folder2</a></li>
  </ul>
  
  <p>my website redirect to </p>
  
  <ul>
  <li><a href="http://localhost/folder2" rel="nofollow">http://localhost/folder2</a> </li>
  </ul>
  
  <p>because my website contains folder2 in my directory structure. </p>
  
  <p>When user hits </p>
  
  <ul>
  <li><a href="http://localhost/mywebsite/folder2" rel="nofollow">http://localhost/mywebsite/folder2</a></li>
  </ul>
  
  <p>my htaccess should ignore this URL because I want to redirect user to index.php which present in folder2</p>
  
  <p>The code written below is present in my htaccess file</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteRule ^(.*)/$ /$1 [L,R=301]
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^ index.php [L]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>What should I do?
  Please help me out from this problem.</p>