[users@httpd] Mod_rewrite - how to do operations on entire URL including query string?

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

 



We are receiving URLS that we need to do two things to:

1) First unescape the entire URL including the query string
2) Change the question mark in front of the text STRING to its escaped
version - %3F

Then take the transformed URL and perform a GET back to the Apache
server that did the two transformations. 

The enclosed Perl program does what I described above. However, we do
not have mod_perl installed on these Apache servers so I have to use a
mod_rewrite solution.



---- snip -----

use strict;

use File::Slurp;
use URI::Escape;



my $url = File::Slurp::read_file STDIN ;

# unescape the entire URL with query string. this is very important
# as the %2F characters must be sent to recipient with them unescaped
$url = uri_unescape $url;

# escape the question mark just before "STRING"
$url =~ s!([?]STRING)!uri_escape($1)!e;


print $url

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