title: conditional DirectoryIndex based on IP address, using .htaccess
body: <p>I've got this in <code>httpd.conf</code>:</p>
  
  <pre><code>&lt;VirtualHost xx.xxx.xx.xxx&gt;
      Options All +ExecCGI
      ServerAdmin hostmaster@thehost.com
      DocumentRoot /var/www/html/domain.com
      ServerName  dl.domain.org
      DirectoryIndex dlindex1.html
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>... which is fine (what I need as the <code>DirectoryIndex</code> for our 'dl.domain.org' subdomain), <em>but</em> now I also need to alter that <code>DirectoryIndex</code> based on IP address, using <code>.htaccess</code>.
  Is this possible?</p>
  
  <p>Other SO posts are telling me that I cannot set <code>DirectoryIndex</code> conditionally.. but instead <em>have</em> to use a <code>RewriteRule</code>.
  If that is true, OK, but what <code>RewriteCond</code> and <code>RewriteRule</code>?
  I am pretty noob in Apache, but anyway have tried many things, including (where the actual IPs are those of our 2 devs):</p>
  
  <pre><code>RewriteCond %{REMOTE_ADDR} ^111\.222\.333\.444$    [OR]
  RewriteCond %{REMOTE_ADDR} ^555\.666\.777\.888$
  RewriteCond %{SERVER_NAME} ^dl.domain.org
  RewriteRule ^(.*)/$ $1/dlindex2.html
  </code></pre>
  
  <p>..or even just (as an absolute test):</p>
  
  <pre><code>RewriteCond %{REMOTE_ADDR} ^555\.666\.777\.888$
  RewriteRule (.*)/dlindex1.html$ $1/dlindex2.html
  </code></pre>
  
  <p>But it seems that whatever I try it just serves up the <code>DirectoryIndex dlindex1.html</code> as per <code>httpd.conf</code>, as opposed to the <code>dlindex2.html</code> I want served up as the default page in that subdomain when a devs IP is calling.</p>
  
  <p>Can any one point me to what I can do to get what I am after? i.e. this: ...to actually, or even just effectively, alter <code>DirectoryIndex</code> based on IP address, using <code>.htaccess</code>, on the fly?</p>