Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This relates to the question in:

The answer states that the following should work:

SetEnvIf Remote_Addr ^127\.0\.0\.0$ owner
<IfDefine owner>
    DirectoryIndex index.html
<IfDefine !owner>
    DirectoryIndex index.php

I am not sure this works, the setting of the Env var deffinately does, but no matter what IP I visit the site from the DirectoryIndex is always index.php

Is there something wrong with the conditional or should I be using something else?

Thanks in advance

share|improve this question

I have ended up using the following to achieve what I wanted

RewriteCond %{REMOTE_ADDR} ^111\.111\.111\.111$
RewriteRule (.*)/$ $1/index.php

RewriteCond %{REMOTE_ADDR} !^111\.111\.111\.111$
RewriteRule index.php$ index.html


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.