title: .htaccess in subdirectory 'overriding' parent htaccess
body: <p>been searching for 2 days and can't quite get the right solution due to my lack of understanding of mod_rewrite and time constraints on this project so hoping someone can help.</p>
  
  <p><strong>The aim</strong></p>
  
  <p>To rewrite all requests to the root index.php if the client doesn't have the correct cookie.
  If the client has the correct cookie allow them to browse as they wish.</p>
  
  <p><strong>The problem</strong></p>
  
  <p>The htaccess in my subdirectory is taking precendence over my root htaccess, so requests such as www.mydomain.com/subdir/index.php arn't getting redirected.</p>
  
  <p><strong>My root .htaccess</strong></p>
  
  <pre><code>Options FollowSymLinks
  RewriteEngine On
  RewriteBase /
  RewriteCond %{HTTP_COOKIE} !^.*pass.*$ 
  RewriteCond %{REQUEST_URI} !^/index.php$
  RewriteRule ^(.*)$ http://www.mydomain.com/index.php?url=$0 [NC]
  </code></pre>
  
  <p><strong>My subdir htaccess</strong></p>
  
  <pre><code>RewriteEngine On
  RewriteBase /
  RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /index.php?/$1 [L]
  </code></pre>
  
  <p><strong>Additional info</strong></p>
  
  <p>Ideally I'm trying to create a password protected area, so all requests are routed to index.php where a password can be entered and when verified a cookie is created, allowing free browsing of contents and sub directories. So if there is a better way to accomplish this then please let me know, and I havn't gone for .htpasswd since I need custom login, error and splash pages.</p>
  
  <p>Also, the subdir .htaccess is an ExpressionEngine URL handler.</p>
  
  <p>Thanks. </p>