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

How can i redirect all the requests that are made to to and then rewrite as

share|improve this question
Doing that would cause users to be redirected in an endless loop, so I suspect that's not what you really want. Can you clarify your question to describe what it is you mean to accomplish? –  Michael Hampton Jul 11 '12 at 8:35
I have no index.php in my root directory and don't want one and i want to treat another file as index.php. Is that possible? –  Amna Ahmed Jul 11 '12 at 8:39

1 Answer 1

up vote 4 down vote accepted

Use the Apache DirectoryIndex directive to specify which file or files should be treated as the directory index.


DirectoryIndex index_main.php
share|improve this answer
That works, thanks! –  Amna Ahmed Jul 11 '12 at 8:45

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.