>Number: 4379 >Category: mod_alias >Synopsis: RedirectMatch cannot redirect to cgi script and pass parameters >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: open >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Mon May 10 05:30:01 PDT 1999 >Last-Modified: >Originator: [EMAIL PROTECTED] >Organization: apache >Release: 1.3.6 >Environment: SunOS motrak04 5.6 Generic_105181-11 sun4u sparc SUNW,Ultra-4 >Description: We are upgrading from NCSA to Apache and used to use the Redirect directive in .htaccess files to run cgi scripts and pass parameters to them on request of certain documents. We want to use the RedirectMatch directive as this is exactly the functionslity that we want. This solution doesn't seem to work though.
If a RedirectMatch statement redirects URL that is the location of the cgi and parameters then the script fails. The exact same line works correctly if you use Redirect instead, but we require an explicit match as if you use point you browser at the redirected page but add a '/something' to the end, that gets appended to the rewritten URL and therefore appended to the last variables value. #This Works Redirect /some/place/to/redirect/from.html http://www.server.com/cgi-bin/script.cgi?var1=value #This Doesn't RedirectMatch ^/some/place/to/redirect/from.html$ http://www.server.com/cgi-bin/script.cgi?var1=value What I get is the error 'The document contained no data.' >How-To-Repeat: If you create a Redirect statement to a cgi including parameters(i.e. URL will include a '?') works fine, but if you use RedirectMatch it doesn't work. >Fix: >Audit-Trail: >Unformatted: [In order for any reply to be added to the PR database, ] [you need to include <[EMAIL PROTECTED]> in the Cc line ] [and leave the subject line UNCHANGED. This is not done] [automatically because of the potential for mail loops. ] [If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request ] [from a developer. ] [Reply only with text; DO NOT SEND ATTACHMENTS! ]