httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcus Johansson" <>
Subject [users@httpd] mod_rewrite - rules loop even though I use the last/L command
Date Wed, 16 Jun 2004 10:11:03 GMT

This might seem a little strange, but I really need to rewrite URL:s
this way. The background to my problem is that I want the following URL

To the following URL:

As tou can see, I want to change the querystrings question mark to an
underscore making it a part of the file, and then make the comma sign
the REAL questionmark for the querystring.

At the very end of my httpd.conf file I have put the following commands:

   <Location "/directory/">
      RewriteEngine On

      RewriteCond       %{QUERY_STRING}         !^$
      RewriteRule       (.*)    $1_%{QUERY_STRING}? [T=text/html]

      RewriteCond       %{REQUEST_URI}          .*,.*
      RewriteRule       (.*),(.*)   $1?$2 [L,T=text/html]

The first RewriteRule works fine. It changes the "?" to an aunderscore.
The second rule seemes to work as well, I think it gets changed to a
querystring, but the first rule then changes the querystrings question
mark to an underscore (I'm not sure that this is the case, but it do
seem that way).

This URL:

Becomes this URL:

Which wasn't my intention.

My question to you is:
Why does the first rule run again, even though I am using the L command
on the second rule?

I'm running apache 1.3.31 on a Solaris 8 machine.

Any help would be greatly appreciated!

Marcus Johansson

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