Apache/PHP is determined to serve the wrong file

Posted by Lucas on Stack Overflow See other posts from Stack Overflow or by Lucas
Published on 2010-04-12T08:12:57Z Indexed on 2010/04/12 10:23 UTC
Read the original article Hit count: 190

Filed under:
|
|
|

I have a page that is called with a url like http://testserver/path/to/foo/bar/ but apache is serving the wrong file altogether.

/path/to/ is a real directory where all the code and .htaccess file is. foo/bar/ is supposed to redirect to foo_bar.php with a RewriteRule, but it never gets there. It's not a mod_rewrite issue as I have commented out all the rules that could be interfering, which should give me 404s for that request, but the same problem occurs:

the file that is served is /path/to/foo.php, so in it I var_dump $_SERVER and get:
REQUEST_URI = /path/to/foo/bar/
SCRIPT_NAME = /path/to/foo.php
SCRIPT_FILENAME = /real/path/to/foo.php
PATH_INFO = /bar/
PATH_TRANSLATED = /real/bar/
PHP_SELF = /path/to/foo.php/bar/

Why is this request being routed to this file at all?

© Stack Overflow or respective owner

Related posts about apache2

Related posts about php