Jump to content

Php For Index Page


Recommended Posts

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

Link to post
Share on other sites

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.

Link to post
Share on other sites

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).

Link to post
Share on other sites

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

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...