httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Covener <cove...@gmail.com>
Subject Re: [users@httpd] RewriteCond how to set variable
Date Tue, 21 Dec 2010 17:31:35 GMT
> 1)      RewriteCond %{QUERY_STRING} !XSL=NONE [NC]
>
> 2)      RewriteCond %{QUERY_STRING} calId=([0-9]+) [NC]
>
> 3)      RewriteCond %{QUERY_STRING} skinId=([0-9]+) [NC]
>
> 4)      RewriteRule ^/calendar
> http://test.webservices.illinois.edu/calendar/list/%1?skinId=%2      [L]

some other options to try:


If you know the order, you can capture them all at once.

RewriteCond %{QUERY_STRING} callId=(\d+).*skinId=(\d+)

or if you only have two vars but don't know the order:

RewriteCond %{QUERY_STRING} callId=(\d+).*skinId=(\d+) [OR]
RewriteCond %{QUERY_STRING} skinId=(\d+).*callId=(\d+)

Otherwise, you can use and re-capture them to pass them along assuming
you don't expect a comma in your query string:

 RewriteCond %{QUERY_STRING} calId=([0-9]+) [NC]
 RewriteCond %{QUERY_STRING},%1 skinId=([0-9]+).*,(\d+) [NC]>

-- 
Eric Covener
covener@gmail.com

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