Alternative to index.php using .htaccess

2

How do I .htaccess put another file, other than index.php , as primary, that is, put a file named home.php and make it work as if it were a index.php .

I'd also like to know some defensive configurations that it allows you to do over directories.

    
asked by anonymous 17.11.2014 / 11:14

1 answer

6

To change index.php to another file home.php use this line in your .htaccess

DirectoryIndex home.php

But if you want all hits to point to home.php , 2 lines are enough on your .htaccess :

RewriteEngine on
RewriteRule . home.php [L]

And to not list the files in a directory, add this line at the beginning of .htaccess :

Options -Indexes
    
17.11.2014 / 12:27