Is "index.php" a necessary file name?
Posted by: jPaulB (---.cpe.net.cable.rogers.com)
Date: May 20, 2022 05:02PM

Hi Everybody,

Wampserver has been working perfectly, for as long as I've been using it to work web sites. I been retired throughout that period and my passion/hobby has become web sites.

So! On to my question: Wampserver works flawlessly as long as I point to the right directory in the Virtual Hosts list AND name the file in question "index.php"

Is that really necessary, or can I point Wampserver directly to the file I want to test, say "test.php"?

If I can do that, How?

If not, thank you for tasking some of your time to consider this on my behalf.

Many Thanks,
Paul

(If I wasn't so stupid, I wouldn't have to be so persistent)

Options: ReplyQuote
Re: Is "index.php" a necessary file name?
Posted by: Otomatic (Moderator)
Date: May 20, 2022 05:21PM

Hi,

If no filename is specified in the url, it will automatically execute the index.php or index.html file if it exists. This is not specific to Wampserver but to Apache and it is defined by the DirectoryIndex directive in the httpd.conf file, of course, provided that the dir_module is loaded, which is done by default.

See : DirectoryIndex

If you want to launch a file other than index.php you must add it by hand in the url.

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.9 32 bit - Apache 2.4.53 - PHP 8.1.5…5.6.40 - MySQL 5.7.38 - MariaDB 10.5.13/10.6.5
Wampserver 3.2.9 64 bit - Apache 2.4.53 - PHP 8.1.5…5.6.40 - MySQL 5.7.38/8.0.29 - MariaDB 10.5.15/10.7.3
PhPMyadmin 5.1.3 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote


Sorry, only registered users may post in this forum.