Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have number of directories under Apache webserver on linux. I need a file - index.html in each directory. Can I keep a master index.html file in a specific location and tell apache to use this just incase there is no real index.html file in one of the sub directories ?

share|improve this question

1 Answer 1

Try something like this (You need to enable Mod_rewrite)

RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/user_dir/index.html !-f
RewriteRule (.*) /master_dir/index.html [L] 
share|improve this answer

Your Answer


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