views:

13

answers:

1

In my htaccess file I have the following redirections:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
RewriteRule index.html$ Controller/index.php [L]
</IfModule>

I want index.html (which does not exist) to be redirected to my controller. index.php (which exists) should be my home page.

Now, my homepage is not working when typing http://www.domain.com/ in my browser. That URL redirects to my controller. http://www.domain.com/index.php works fine, bringing my homepage.

How do I set index.php as my index file keeping my redirection for the controller?

A: 

If I've understood your situation correctly, you just want to specify DirectoryIndex in your .htaccess file so that it only points to index.php:

DirectoryIndex index.php

Between that and your rules, that leads to the following URL to file mappings:

http://www.example.com/           -> /index.php
http://www.example.com/index.php  -> /index.php
http://www.example.com/index.html -> /Controller/index.php
Tim Stone
Additionally, for future reference, this is somewhat more of a [ServerFault](http://serverfault.com/) question.
Tim Stone
Thanks for your answer, Tim. That didn't do it, I still have the same issue. I'll ask on ServerFault.
Gerardo