Index.PHP Not Loading by Default

index.php not loading by default

Apache needs to be configured to recognize index.php as an index file.

The simplest way to accomplish this..

  1. Create a .htaccess file in your web root.

  2. Add the line...

DirectoryIndex index.php

Here is a resource regarding the matter...

http://www.twsc.biz/twsc_hosting_htaccess.php

Edit: I'm assuming apache is configured to allow .htaccess files. If it isn't, you'll have to modify the setting in apache's configuration file (httpd.conf)

index.php is not loading by default in apache2

This is likely a caching issue in your browser when you go to http://localhost/ try pressing Ctrl + F5

index.php is not loaded by default

Apache

Create a .htaccess file under the root of your project and put this:

DirectoryIndex index.php

Nginx

$ cd /etc/nginx/sites-available/default

 
Index index.html index.htm, index.php;

Lighttpd

$ nano /etc/lighttpd/lighttpd.conf

 

index-file.names = ( "index.php", "index.html" )

apache not returning index.php as default

You are missing following configuration:

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html index.htm \
default.php default.pl default.cgi default.asp default.shtml default.html \
default.htm home.php home.pl home.cgi home.asp home.shtml home.html home.htm
</IfModule>


Related Topics



Leave a reply



Submit