Tuesday, November 19, 2019

apache 2.2 - index.php not automatically read by localhost



I just installed Apache, php and MySQL manually in windows 8. It works fine




but the problem is when i try to open the directory in browser it auto opens index.html but not index.php



for ex: i have following folder structure



htdocs->folder1->index.php



if i access "localhost/folder1/index.php" it loads fine, but if i access"localhost/folder1" then it will show all the files and folder in that folder.



Is there anyway I can make localhost open index.php open automatically and not show files inside that folder?


Answer




Check that the DirectoryIndex directive is set correctly in you apache configuration file e.g.



DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...