Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 example.com, 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 example.com/home/, 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. –  Thomas Sep 24 '12 at 16:23
add comment

2 Answers

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
add comment

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

<?php
   include("html/index.html");
?>
share|improve this answer
add comment

Your Answer

 
discard

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.