title: mod_rewrite fail: .htaccess or server config issue?
body: <p>The application i'm developing uses a certain file directory structure. Via the use of mod_rewrite and .htaccess files, i manage to have friendly urls for our users. It works fine on my local server, but once on the production server, it fails: apparently, the server throws a 404 error before the .htaccess has a chance to kick in.</p>
  
  <p>Here is the .htaccess i'm working on (referenced as (1) here below):</p>
  
  <pre><code>IndexIgnore *
  #Options +FollowSymLinks
  RewriteEngine on
  
  RewriteOptions inherit
  
  RewriteCond %{REQUEST_FILENAME} !-f [NC]
  RewriteRule ^(.*)$ /~extranet/extranet/$1 [NC,L,QSA]
  </code></pre>
  
  <p>On the server, it returns 404:</p>
  
  <blockquote>
    <p>The server can not find the requested
    page:</p>
  
  <pre><code>&lt;IP-ADDRESS&gt;/~extranet/extranet/dev/foo/
  </code></pre>
    
    <p>(port 80)</p>
  </blockquote>
  
  <p>In fact, it seems any redirect fails, although phpinfo() lists mod_rewrite among the loaded modules.</p>
  
  <p>The server is brand new. (In case it helps, the 404 page lists Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.8 Server )</p>
  
  <p>Where should i look for the mistake/misconfiguration?</p>
  
  <p>UPDATE: more information</p>
  
  <p>here is the file/folder structure and each .htaccess used:</p>
  
  <pre><code>&lt;IP-ADDRESS&gt;/~extranet/.htaccess (1)
  &lt;IP-ADDRESS&gt;/~extranet/extranet/
                                L .htaccess (2)
                                L/dev/
                                     L .htaccess (3)
                                     L index.php
                                L/stable/
                                     L .htaccess (3)
                                     L index.php
  </code></pre>
  
  <p>(1) redirects all requests to folder "extranet"
  (2) redirects all requests not containing "/dev/" to folder "stable"
  (3) rewrites /extranet/foo/bar/ to  index.php?app=foo&amp;do=bar</p>