Under Apache/1.3.24 and PHP/4.3.1, I am getting odd behaviour.
I don't need the .php extension. I can go to http://127.0.0.1/test/2, and it'll work just like http://127.0.0.1/test.php/2. Is this normal behaviour, or have I changed something and forgotten? What would I have done to cause this behaviour?
Apache's Mystery Behaviour
Moderator: General Moderators
test.php is a file. I'm taking advantage of the fact that apache will walk backwards through the URI (right term?) to make it use test.php. It just makes URLs a little easier to remember. Here's how it's all set up.
A (pretty) directory listing
As you can see, there is no /test/ diectory, nor a /test.php/ directory. In the URL HTTP://127.0.0.1/TEST.PHP/2, PHP_SELF is /TEST.PHP/2, which when explode()ed, it results in
[2] is what I use to interrogate the mySQL database for the correct information.
While I probably went overboard in explaining how my script works, I hope it's a little clearer. I'll reprase my question, if I may.
When I request http://127.0.0.1/test.php/2 I am given all the content for page 2. If I request http://127.0.0.1/test/2 the same happens. Why does this happen?
A (pretty) directory listing
Code: Select all
/
|- index.php
|- test.php
|- common.php
|- config.php
|- .htaccess
|
|-/dev/
| |- .htaccess
| |- common.php
| |- config.php
|
|-/images/
| |- iip.gif
| |- logo.gif
|
|-/phpMyAdmin-2.5.0/
| |- Too many for me to typeCode: Select all
Array
(
ї0] =>
ї1] => test
ї2] => 2
)While I probably went overboard in explaining how my script works, I hope it's a little clearer. I'll reprase my question, if I may.
When I request http://127.0.0.1/test.php/2 I am given all the content for page 2. If I request http://127.0.0.1/test/2 the same happens. Why does this happen?
http://httpd.apache.org/docs-2.0/mod/mod_negotiation.html#multiviews
That's probably what's causing it
That's probably what's causing it