www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aycan Gulez <ay...@wowwebdesigns.com>
Subject mod_rewrite/7455: Apache overrides rewrite engine directives, automatically returns a PHP file even if only its name matches (not its extension)
Date Sat, 24 Mar 2001 07:19:51 GMT

>Number:         7455
>Category:       mod_rewrite
>Synopsis:       Apache overrides rewrite engine directives, automatically returns a PHP
file even if only its name matches (not its extension)
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Fri Mar 23 23:20:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     aycan@wowwebdesigns.com
>Release:        1.3.19
>Organization:
apache
>Environment:
Linux 2.2.16 #22 i486 unknown (slackware 7.1)
>Description:
I don't know if this is a standard behavior of Apache, but even if it is so there seems to
be a bug that interferes with mod.rewrite. If Apache cannot find the requested file name or
directory it automatically looks for a matching file, and if it finds one, it returns the
contents of that file even if its extension doesn't match. The problem is compounded with
PHP files and rewrite rules (some of the rules are not executed if they conflict with this
behavior). I included an actual example.
>How-To-Repeat:
There is a single file called a.php in http://www.wowwebdesigns.com/test/ . You can see it
if you visit the above URL. If you enter http://www.wowwebdesigns.com/test/a (note that there
is no extension) Apache should return an error, but it rather returns a.php (you should see
'Gotcha!'). It is even worse when you enter something like this http://www.wowwebdesigns.com/test/a/abc
. It still works. This behavior ruins some of my rewrite rules. I didn't change anything in
my configuration files. I was using 1.3.12 before, and everything was working fine. When I
updated Apache to 1.3.19 I noticed the problem. For instance, the following rule doesn't work
anymore if a.php exists (the rule is not even executed):

RewriteBase /homedir/aycan/test
RewriteRule ^a/id_([0-9]+)/$   a.php?id=$1
>Fix:
Unfortunately no.
>Release-Note:
>Audit-Trail:
>Unformatted:
 [In order for any reply to be added to the PR database, you need]
 [to include <apbugs@Apache.Org> in the Cc line and make sure the]
 [subject line starts with the report component and number, with ]
 [or without any 'Re:' prefixes (such as "general/1098:" or      ]
 ["Re: general/1098:").  If the subject doesn't match this       ]
 [pattern, your message will be misfiled and ignored.  The       ]
 ["apbugs" address is not added to the Cc line of messages from  ]
 [the database automatically because of the potential for mail   ]
 [loops.  If you do not include this Cc, your reply may be ig-   ]
 [nored unless you are responding to an explicit request from a  ]
 [developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]
 
 


Mime
View raw message