1

I have a PHP project which has many files. I have configured it properly and it's working.

But I want that whenever I type (only) localhost in my browser, it should lead to the main page of my project.
Right now, the scenario is whenever I do that, it shows the php directory like this:

Index of /
adddet.php
client/ 
dbconn.php
deldet.php
login.php
main.php
Jan Doggen
  • 8,799
  • 13
  • 70
  • 144

2 Answers2

1

I will just assume you are using Apache as your web server.

Rename main.php to index.php or adjust httpd.conf like follows.

DirectoryIndex index.html index.htm default.htm index.php index.pl main.php

You need to use DirectoryIndex directive under Apache to set a default page other than index.html or index.php.

Tony Stark
  • 2,318
  • 1
  • 22
  • 41
0

You could also use the rewrite enigne of apache2:

RewriteEngine On
RewriteRule ^(.*)$  /main.php [R,L]

Best regards!

Stefan
  • 21
  • 3