Forum Moderators: coopster

Message Too Old, No Replies

How to load index.php first?

         

phprockz

6:43 am on Mar 2, 2006 (gmt 0)

10+ Year Member



Hi ,
i have two fiels in server index.html and index.php..I need to load index.php first.But its loading index.html first.How to do like that plz let me know

Phatzo

6:52 am on Mar 2, 2006 (gmt 0)

10+ Year Member



If you're running apache, you can use a .htaccess file, something like this:

Options All -Indexes
Options +FollowSymLinks
RewriteEngine On

DirectoryIndex index.php
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule ^(.*) index.php

search google for htaccess tutorial and you will find plenty of free (and easy!) tutorials to help you out. In this example, its the last line in the codeblock above that tells the server to use index.php. it could be any file you want, not necessarily index.<something>.

hope this helps.

omoutop

11:10 am on Mar 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



or in .htaccess write :

DirectoryIndex index.php

same results both ways