Unescaping backreferences in mod_rewrite to embed email address in url?

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

 



Hi --

Is it possible to have mod_rewrite unescape backreferences? I would like to allow users to access resources through a user-specific URLs, created by embedding a user-provided email address in the URL:

/docs/testuser@xxxxxxxxx

I have a form that allows users to enter their email and submits a GET to a CGI:

http://www.example.com/cgi-bin/test.cgi?email=testuser%40yahoo.com

I've created a mod_rewrite rule to trap the above pattern and rewrite it:

RewriteCond %{QUERY_STRING} email=([\w@0123456789%\.]+)$
RewriteRule ^/cgi-bin/test.cgi /docs/%1 [PT]

The above is not a very sophisticated email match, but works for this example. This gives me:

/docs/testuser%40yahoo.com

Is there a way to tell mod_rewrite to un-escape the matched backreference so I get the @ sign in the URL instead of %40?

Thank you in advance!

Ramon

[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