httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <>
Subject RE: [users@httpd] rewriting condition ignored
Date Wed, 04 Jun 2003 14:36:19 GMT
>-----Original Message-----
>From: michael portmann []
>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
> - - [04/Jun/2003:15:54:10 --0400]
>[xxxx/sid#814b3f8][rid#81a1328/initial] (4) RewriteCond: 
>(compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR
>1.1.4322)' pattern='^Mozilla/4*' => matched
> - - [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:


(the "." means any character) or just 


and stop the match after the 4.

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:> for more info.
>To unsubscribe, e-mail:
>   "   from the digest:
>For additional commands, e-mail:
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:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message