I've run into a rather, well, unusual problem. I've been doing searches through various forums but haven't come across anything. I thought someone here might have a suggestion or 2.
We currently have an application written in PHP (5.3) running on a Linux server running Centos (5) and Apache (2). The application runs fine on the server.
However, I need to duplicate the environment on a new server. (Same version of PHP/Apache/Linux). Now, here's the problem:
The 'default' file for the application is called 'index.php' (and its included in the DirectoryIndex directive in the apache configuration files.) So, I can use either:
h t t p://<mysite>/index.php
or
h t t p://<mysite>/
And both of these work on both the old and new server. (If you don't supply the 'index.php', the configuration files know that that is the name of the routine to call anyways.)
Now, the application has been set up to use parts of the URL to pass information into the application. So, it uses:
h t t p://<mysite>/index.php/somestuff
- - - -----------------------^^^^^^ Where 'somestuff' is extra information passed to php
Here's where I run into problems: In the site I'm trying to replicate, they (the original site authors) have done something unexpected to apache. Somehow, they've set things up so that:
h t t p://<mysite>/index.php/somestuff
and
h t t p://<mysite>/somestuff
are functionally equivalent. (i.e. the second line manages to find and execute the php script.) However, when I try to use the same URL on my site, it fails (with a 404). So, they have Apache set up to find default PHP files when its theoretical location is embedded in the middle of a URL, while my setup can only find the default PHP when the end location is a directory.
Anyone have any idea how they may have done this? (I've tried adding various aliases to the apache config files, specified the default in the .htaccess file, etc., but no luck so far.) The problem might be the AcceptPathInfo directive, but if that was an issue wouldn't it have also failed when the URL contained the index.php too?
Unfortunately nothing was documented, and configuration files are spread out among the standard httpd.conf file, directives in the conf.d directory, and .htaccess entries..
The people who set up the original Apache server were either really really brilliant, or really really dumb. Can't quite figure out which it is.