php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24408 misinterpretation (file as a folder/directory - without an error)
Submitted: 2003-06-30 09:40 UTC Modified: 2003-07-03 03:38 UTC
From: theo at sponholz dot de Assigned:
Status: Not a bug Package: *Directory/Filesystem functions
PHP Version: 4.3.1 OS: Linux 2.2.24-6.2.3
Private report: No CVE-ID: None
 [2003-06-30 09:40 UTC] theo at sponholz dot de
Description:
------------
the Apache/1.3.26 with php-mod misinterprets a file as a directory
for example:
http://www.sponholz.de/theo.php/
(there is no dir. "/theo.php/" under "http://www.sponholz.de/", just a file "theo.php")

if you type "http://www.sponholz.de/theo.php" the site will be shown correctly. 

if you type "http://www.sponholz.de/theo.php/" (with an ending [SLASH]), then the server shows a site without CCS and pictures. Boths are included relativ. 

further: 
you can add strings like:
"http://www.sponholz.de/theo.php/type.PHP.what.PHP.you/.want"
instead of returning an error
"http://www.sponholz.de/theo.php/"
will be shown.

my problem / wish:

i wanna get an error, when a file or a dir./folder does not exist. 

by the way (i tried this @ php.net, but the php.net-server refers to google ...)
thx 4 help,
theo


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-30 12:10 UTC] sniper@php.net
Too old PHP version, plus it's not a bug but feature.. :)

 [2003-06-30 12:26 UTC] theo at sponholz dot de
is it possible to disable this feature?
THEO
 [2003-06-30 13:00 UTC] sniper@php.net
Without knowing what you're actually doing there, I've no idea how you could 'disable' it..

Using 4.3.2 I can't reproduce anything like your site has.

 [2003-06-30 13:30 UTC] postings-php-bug at hans-spath dot de
I think the "problem" is like this:

If the stylesheet is located at
"http://www.sponholz.de/style.css"
and is refered like
<link rel="stylesheet" type="text/css" href="style.css">
from theo.php, the browser will search for
"http://www.sponholz.de/style.css"
if the request was 
"http://www.sponholz.de/theo.php"
but the browser will search for
"http://www.sponholz.de/theo.php/style.css"
if the request was 
"http://www.sponholz.de/theo.php/"

So this is indeed no PHP bug, but an Apache feature.

To "fix" this behavior, theo.php should refer to style.css by using
<link rel="stylesheet" type="text/css" href="/style.css">
or
<link rel="stylesheet" type="text/css" href="http://www.sponholz.de/style.css">
 [2003-07-03 03:38 UTC] theo at sponholz dot de
i know that i can use absolute links, but i don't want to.
an other problem, caused by my first one, 
is shown @
http://www.sponholz.de/bilder/sp.de.uo.jpg
[some searchengines impair my user online status]

i installed apache 2 (php432) on my local pc [Win32] to check ...
 - the same problem

my question:
is it a feature of php or of apache?
THX, 
THEO
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Jul 07 07:03:38 2022 UTC