I have a general question.
I am re-designing a site and in the meantime users are directed to the old site with a meta refresh that I put in the index.html in the root of the server. The new website will start from index.php.
So far I have kept index.php renamed to _index.php to avoid that some user accidentally might see the new site...
In other words I want the users to always see index.html until I don't delete it.
I was wondering if I can keep index.php named as such or if it is safer to keep the underscore in front of its name. If I go to the root I alwyas get the html file but I was wondering if it is possible that some user might get the php file instead... Is it server-side dependent or client-side?
I would think that it is server-side (depending on how Apache is set up on the server) but once I visited a site and I got pages with errors, I let the webmaster know and he was surprised that I even saw them because he was in a similar situation and he said I shouldn't have seen those and seen the regular index.html page instead...
just curious...
index.php & index.html on the same server
Assuming you're using Apache...
In the Apache "httpd.conf" file there's a section that looks like this:
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.php index.htm
</IfModule>
When a non-specific request (e.g. "www.example.com/") is made, Apache checks this list for a match. The first one it finds is the one it serves up. I suspect IIS behaves similarly.
Yes I knew/suspected that, but since we are talking about virtual hosting (ie not my server) I don't have access to that file so I was simply wondering if there was a way to know without looking at the file... And if the way to know is to test it I was wondering if there is any way that a test could have different outcomes on different computers.
I suspect/know you already know/suspect this: ask your hosting provider.
I am afraid you misunderstood me. I didn't mean to sound/read rude or pretentious, I was just trying to extinguish a doubt I've had for some time, ever since a webmaster in my same situation (index.html and index.php on his server) told me he didn't expect me to see one of the two as he would always see the other one of the two).