httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
Subject RE: [users@httpd] rewriting condition ignored
Date Wed, 04 Jun 2003 14:36:19 GMT
>-----Original Message-----
>From: michael portmann [mailto:miporti@gmx.ch]
>
>I have problems rewriting URL's on my apache 2.0.45 system. apache
>seems to ignore RewriteCond.
>
>//conf file
>RewriteCond %{HTTP_USER_AGENT} ^Mozilla/4*
>RewriteRule ^/$     /dir1/index.html
>
>//Error-Log
>10.0.0.7 - - [04/Jun/2003:15:54:10 --0400]
>[xxxx/sid#814b3f8][rid#81a1328/initial] (4) RewriteCond: 
>input='Mozilla/4.0
>(compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR
>1.1.4322)' pattern='^Mozilla/4*' => matched
>[...]
>10.0.0.7 - - [04/Jun/2003:15:54:30 --0400]
>[xxxx/sid#814b3f8][rid#81a1328/initial] (4) RewriteCond:
>input='Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4a)
>Gecko/20030401' pattern='^Mozilla/4*' => matched
>
>
>The first log-entry is ok, but why does the second one match?

Tricksy regexps... The "*" means "0 or more of the previous character".
So "5" is truly "0 or more 4s". I think you really mean "Mozilla/4
followed by anything", in which case you should use:

	^Mozilla/4.*

(the "." means any character) or just 

	^Mozilla/4

and stop the match after the 4.

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 

>
>Thx, eudgster
>
>
>
>---------------------------------------------------------------------
>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
>
>
Diese E-mail ist eine private und persönliche Kommunikation. Sie hat
keinen Bezug zur Börsen- bzw. Geschäftstätigkeit der SWX Swiss Exchange.
This e-mail is of a private and personal nature. It is not related to
the exchange or business activities of the SWX Swiss Exchange. Le
présent e-mail est un message privé et personnel, sans rapport avec
l'activité boursière de la SWX Swiss Exchange.

This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please notify the sender urgently
and then immediately delete the message and any copies of it from your
system. Please also immediately destroy any hardcopies of the message.
You must not, directly or indirectly, use, disclose, distribute, print,
or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail
communications through their networks. Any views expressed in this
message are those of the individual sender, except where the message
states otherwise and the sender is authorised to state them to be the
views of the sender's company. 



---------------------------------------------------------------------
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