httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael D. Berger" <m.d.ber...@ieee.org>
Subject RE: [users@httpd] unexpected RewriteRule behavior
Date Tue, 01 Nov 2005 23:57:45 GMT
> -----Original Message-----
> From: Michael D. Berger [mailto:m.d.berger@ieee.org] 
[...]
> [...]
> > From: Rich Bowen [mailto:rbowen@rcbowen.com] 
> [...]
> > Michael D. Berger wrote:
> > > The following:
> > 
> > >    RewriteCond %{REQUEST_URI} !^.*/picts/.*$
> > >    RewriteRule ^/(.*/)?$ /index.cgi [L]
> > > 
> > > sends
> > >    GET /favicon.ico
> > > to index.cgi .  I would not expect this because it
> > > does not appear to match any pattern.  Wherein do
> > > I err?
> > 
> > The REQUEST_URI is /favicon.ico, and this matches 
> > !^.*/picts/.*$ - that
> > is, it's a string that doesn't contain /picts/ anywhere in it.
> > It also matches the RewriteRule pattern ^/(.*/)?$ because it 
> > starts with
> > a slash, and doesn't contain the optional "something followed 
> > by a slash".
> > So, according to this ruleset, it's supposed to rewrite that 
> > to /index.cgi
> > 
> > So it seems that it's doing exactly what you asked for it to do.
> > 
> > The real question is what you're trying to do with this 
> > rewrite ruleset,
> > since that's not really evident.
> 
> The picts line is functioning as expected.  Such lines are
> handled differently elsewhere. With regard to the RewriteRule
> line, this is functioning correctly only of you ignore the
> '$' end-of-line anchor.  From a linux box:
> 
>    echo // | grep -P "^/(.*/)?$"
>    //
>    echo / | grep -P "^/(.*/)?$"
>    /
>    echo /x.y | grep -P "^/(.*/)?$"
>    echo /x.y/ | grep -P "^/(.*/)?$"
>    /x.y/
> 
> Notice the one line that doesn't echo.  BTW, this is exactly
> what I am trying to do.  The question is why the difference
> between grep -P and RewriteRule?  I have yet to follow the
> advice in another response and turn on logging.

In my attempts to log the problem, I find that I cannot
reproduce it.  It is now functioning correctly.  I added
some more detail to the error log and we can only wait.
Since my daily traffic averages about 5 legitimate hits,
and 50 attacks ("herbs": you are not alone), patience may
be required.

Mike.
--
Michael D. Berger
m.d.berger@ieee.org 
[...]



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message