Re: [users@httpd] using mod_rewrite to change param value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux