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.

Can I configure one specific directory on my webserver to use an atypical default file such as "default.php" instead of "index.php"? Do I have to create a ".htaccess" file in that dir?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

Yep, put the following in a .htaccess file:

DirectoryIndex default.php

And that will apply to that directory, and I think all subdirectories.

This assumes you're using Apache; other webservers may have other conventions.

share|improve this answer
    
How do I set it not to apply to subdirectories? –  Jarvis Jul 8 '09 at 11:13
    
You don't, as far as I know. You need to put in separate .htaccess files for the subdirectories. –  womble Jul 9 '09 at 2:42

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.