Hello, I was wonder if it is possible to change the DirectoryIndex based on the incoming IP address.

Heres a senerio.

We are working on a new site for our company and are doing redirection to pass users to a temp site in a sub folder.

but for us internally, we can goto /index.php and see the new site.

The issue is, is the new site has SEO friendly URLs and wont work if we actually have index.php in the URL, it needs to be just the domain name

so we want to have something like this

if (%{REMOTE_HOST} 71\.211\.XX\.XX)
    DirectoryIndex index.php
    DirectoryIndex default.html


In your apache configuration file you could set the webserver to listen on two different addresses -- one for the LAN and one for the WAN. You could have the webserver serve up different content based on the virtual host.

Will this solve your issue?

Well only issue there is, the site is hosted at GoDaddy, so cant do anything like that.

I did come up with something that works for now, Because default.html was used to just redirect people into a subfolder (where the old site was moved to) i did this

RewriteCond %{REMOTE_ADDR} !^71\.211\.xx\.xx
RewriteCond %{REQUEST_URI} !/tmp_site/
RewriteCond %{REQUEST_URL} !^cmas-email-flyer09.jpg$ //just becasue sales had just sent a mass email with the image in the root. 
RewriteRule (.*) /tmp_site/$1 [L,R=302]

Hope that helps people if they run into a similar situation.

commented: clever +8