Reputation: 24315
Could someone provide an .htaccess rule such that my index.php overrides my index.html?
Meaning that index.php, and not index.html, is served when I go to http://localhost
.
Upvotes: 2
Views: 1462
Reputation: 4495
This may work instead...
RewriteEngine On
RewriteBase /
RewriteRule ^index.html$ index.php [R=301,L]
Upvotes: 2
Reputation: 4452
In the apache configuration file (or .htaccess), set DirectoryIndex to index.php, instead of index.html
Here is an example: http://www.javascriptkit.com/howto/htaccess6.shtml
Upvotes: 0
Reputation: 3121
That will do the job:
DirectoryIndex index.php index.html
In case there is no index.php the index.html file will be served instead.
Upvotes: 4