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

In my document root, I have to directories: home and foobar, both with their own index.html files.

How can I set it up so that when someone visits my site at, they see the contents on home/index.html?

I tried using an index.php with a redirect in document root, as well as a .htaccess redirect, but both of them change the URL in the browser to, which I would like to ideally avoid.

share|improve this question
If you need the 'big gun': mod_rewrite First check if requested file is present. If it is, return it. If not, rewrite to '/home'. Sorry no code example at hand right now. – Roman Sep 24 '12 at 16:23

Why don't you just move the contents of home up one directory?

share|improve this answer
Because the contents of each directory in my document-root belong to a different git repo. Having the contents of home up one level will cause me to commit other projects (in the wrong repo) as well when I commit the contents of home. – xbonez Sep 24 '12 at 15:30

What about the simplest solution: Creating a simple PHP file that includes the document?

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.