httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DM <donalmurt...@yahoo.co.uk>
Subject Re: [users@httpd] using mod_rewrite to change param value
Date Fri, 10 Nov 2006 18:37:03 GMT
Hi,

Thanks for the advice about QUERY_STRING. Please allow me to re-state my problem and my current
attempt at a solution:

I want to rewrite a URL such as:

http://www.example.org/myProgram?param1=val1&url=http://cellularlmanagerpp.aliant.net/foo/bar.html

to

http://www.example.org/myProgram?param1=val1&url=http://erie:9090/foo/bar.html

Currently, I'm using the following RewriteRule:

RewriteCond    %{QUERY_STRING}     ^(.*)url=http%3A%2F%2Fcellularmanagerpp%2Ealiant%2Enet(.*)$

RewriteRule     ^(.*)$              %3?%1url=http%3A%2F%2Ferie%3A9090%2


My intention is this

- the first pattern captured (%1) in RewriteCond will be everything from the start of the
query string up to "url" 
- the second pattern captured (%2) in RewriteCond will be everything in the query string after
"aliant.net"
- the third pattern captured (%3) in RewriteRule will be everything from the beginning of
the URL to the start of the query string

Therefore "%3?%1url=http%3A%2F%2Ferie%3A9090%2" should produce the URL I want, but unfortunately
it doesn't

Once potential problem I can see is that there is no distinction between the use of "%3" to
replay the third captured pattern and the use of "%3" in "%3A", to represent the ":" character
encoded - should I somehow be escaping the latter?

Thanks in Advance,
DM

Send instant messages to your online friends http://uk.messenger.yahoo.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