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.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.