html or php

Associate
Joined
7 Nov 2006
Posts
438
Hi there everyone, Im building a new website and i dont want to take the old one down. my old one is in html and my new one is in php but the php is a cms system hence needing to be in place to build it.

What my question is, if i have the index.html of my old site and the index.php of my new site which one will the domain pick as i would prefer the html one to be first and the php one to be 2nd until i delete the html one when the new site is done.

I hope i explained this right, thanks. :)
 
Depends on the server configuration. There's a specific Apache directive for defining which file is the default page for a directory. To set this yourself, add the following to an .htaccess in your root directory (or there may be an option in your hosting control panel):
Code:
DirectoryIndex index.html index.php
If the first isn't available, the second will be used, and so on. You can add as many as you like e.g.
Code:
DirectoryIndex homepage.html /foo/bar/baz.php index.html index.htm index.php
http://httpd.apache.org/docs/2.0/mod/mod_dir.html#directoryindex
 
This will work for Apache on Windows or Linux, but it won't work for IIS on Windows. However, if you're running PHP on a commercial host, then you'll almost certainly be using Apache.
 
Back
Top Bottom