Perfect! Thanks very much works a charm. On Thu, May 29, 2008 at 10:11 AM, Severin Gehwolf < [EMAIL PROTECTED]> wrote:
> Hi! > > > I am looking for some advice on how to do exact matching for > > mod_rewrite, I have the 2 rules in my config: > > > > Rule1 > > ==== > > RewriteRule ^/nokian95 /phones.php?id=555 [PT,QSA,NS,NE] > > RewriteCond %{REQUEST_URI} ^(.*)phones\.php(.*)$ > > RewriteCond %{QUERY_STRING} ^id\=555$ > > RewriteRule ^(.*)$ /nokian95? [R=301,L] > > > > > > and > > > > Rule2 > > ==== > > RewriteRule ^/nokian95plum /phones.php?id=588 [PT,QSA,NS,NE] > > RewriteCond %{REQUEST_URI} ^(.*)phones\.php(.*)$ > > RewriteCond %{QUERY_STRING} ^id\=588$ > > RewriteRule ^(.*)$ /nokian95plum? [R=301,L] > > > > Now as the Rule1 is first in the config file then any URL string that > > contains /nokian95 will result in /phones.php?id=555 being called, > > Rule2 will never be matched because Rule1 will match first. > > > > I want to be able to specify that a match is only valid when the text > > to be matched is *exactly* the text in the rewriterule and not just a > > fragmement match. > > Use '$' for matching the ending of a line as follows: > > Rule1: > RewriteRule ^/nokian95$ /phones.php?id=555 [PT,QSA,NS,NE] > > Rule2: > RewriteRule ^/nokian95plum$ /phones.php?id=588 [PT,QSA,NS,NE] > > Similar to '^' - which matches the beginning of the line - '$' matches > any String which ends with the specified characters. > > --- > Severin > > > --------------------------------------------------------------------- > 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: [EMAIL PROTECTED] > " from the digest: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >