httpd-users mailing list archives

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

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
rewritten:
http://domain/directory/file?parA=1&parB=2,parC=1&parD=2

To the following URL:
http://domain/directory/file_parA=1&parB=2?parC=1&parD=2

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]
   </Location>

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:
http://domain/directory/file?parA=1&parB=2,parC=1&parD=2

Becomes this URL:
http://domain/directory/file_parA=1&parB=2_parC=1&parD=2

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!

Regards,
Marcus Johansson

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