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.

How can i redirect all requests to index_main.php to index.php through .htaccess?

share|improve this question

1 Answer 1

Do you mean "from index_main.php to index.php"?

If answer is yes then

RewriteEngine on
RewriteRule ^/index_main\.php$ index.php [L]

UPDATE

To change index file, use DirectoryIndex directive:

DirectoryIndex index_main.php
share|improve this answer
    
I mean i have a page called index_main.php, i want this page to open when someone types my website url, but i want the url to appear as www.mysite.com and not www.mysite.com/index_main.php . how can that be achieved? –  Amna Ahmed Jul 11 '12 at 8:20
    
Oh. Updated answer. –  hangover Jul 11 '12 at 9:23

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.