xplanes Posted May 13, 2006 Posted May 13, 2006 Hello, I'm making my first venture into using PHP for a website I am developing. I am about ready to ftp the content to a existing site with an index.html file. This brings up a few questions I haven't seen addressed in the reading I have been doing. If I use an index page named index.php will I need to have a redirect from the index.html page for it to load when my domain name is typed in the browser address bar or will the server just run the index.php file? Also, what happens if there are both files in a directory? Will the presence of a file named index.php prevent viewing of the directory contents the same way an index.html file will? Thank you for your help, Lou Quote
TCH-Tim Posted May 13, 2006 Posted May 13, 2006 index.php will function exactly like index.html. (In the terms you are asking, anyway.) If you have both files, index.html will come up. So if you aren't using it, delete it, and visitors will see index.php. Quote
chatbug Posted May 13, 2006 Posted May 13, 2006 You can disable index through "Index Manager" in cpanel to prevent viewing directory contents. It is also possible to prevent listing of directory content through .htaccess (but won't return access denied page). Quote
TCH-Don Posted May 13, 2006 Posted May 13, 2006 Hello,Will the presence of a file named index.php prevent viewing of the directory contents the same way an index.html file will? Yes it will Quote
TCH-JimE Posted May 15, 2006 Posted May 15, 2006 Welcome to the forums Xplanes. You can also put in your htaccess the following, and change the priorities depending on which page you want displayed: >DirectoryIndex portal.php index.php index.html index.htm Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.