All pastes #45997 Raw Edit

megaspaz

public text v1 · immutable
#45997 ·published 2006-03-17 04:55 UTC
rendered paste body
# in httpd.conf. if there is drop down behavior, maybe something like this...
RewriteEngine On
RewriteMap  url-decode-map  prg:/path/to/url-decode-map.pl
RewriteRule ^/(.*)$ /${url-decode-map:$1}
RewriteRule ^/quotes(.*)$ https://%{SERVER_NAME}/quotes$1 [R]


# This would be the perl script saved in /path/to/url-decode-map.pl

#!/usr/bin/perl
# This is the url decode script (chmod me to 755): url-decode-map.pl
my $str = $ARGV[0];
$str =~ s/\%([A-Fa-f0-9]{2})/pack('C', hex($1))/seg;

return $str;