views:

151

answers:

2

I have a site that is arranged thus:

/about

/css/

/index/index.php

/js/

/index.php

index.php uses a PHP redirect to index/index.php

I want to create a .htaccess rewrite rule so that when the root is accessed, /index/index.php is displayed BUT /about etc. stays the same.

+1  A: 

The following will make / display index/index.php as its index file

DirectoryIndex index/index.php

Just put it in the .htaccess for /

Sionide21
That would affect every directory underneath / as well, which will cause quite a few problems.
R. Bemrose
That's true, I guess you would also have to reset it in subfolders.
Sionide21
A: 

If you have mod_rewrite this should work:

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

That will only match / (which it sees as empty) and internally redirect to /index/index.php

Sionide21