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

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

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.