httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
Subject RE: [users@httpd] Rewrite or redirect difficulties with CGI query parameters
Date Fri, 23 Jan 2004 08:32:18 GMT
> -----Original Message-----
> From: Clay Redding [mailto:clay@monarchos.com]
> Sent: Donnerstag, 22. Januar 2004 21:37
> To: users@httpd.apache.org
> Subject: [users@httpd] Rewrite or redirect difficulties with CGI query
> parameters
> 
> 
> Hi,
> 
> I have what seemed to be a simple fix in redirecting 2 existing URLs,
> which are mapped to a ScriptAlias, to two new URLs.  I've RTFM plus
> some, but something isn't seeping into my brain correctly.
> 
> The original URLs (with query strings for a HTTP POST) take the form:
> 
> /webpac-bin/wgbroker?new+-access+top.icos
> /webpac-bin/wgbroker?new+-access+top.aipnbl

Have a look at this archive message from a few days ago - it's pretty
close to your problem (key point: the query_string is not part of the
URL, it's a separate ENV variable).

http://marc.theaimsgroup.com/?l=apache-httpd-users&m=107467737513609&w=2

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 

> 
> I'd like to map it to the following server, which is running on the
> same box, but using a non-Apache J2EE servlet engine on port 81:
> 
> http://sameserver:81/ipac20/ipac.jsp?profile=icos
> http://sameserver:81/ipac20/ipac.jsp?profile=aipnbl
> 
> So, in my config, I have the following:
> ~~~~~~~~~~~~~~~
> <Directory "/usr/local/etc/httpd2/webpac-bin">
>         AllowOverride All
>         Options All
>         <Limit GET>
>         order allow,deny
>         allow from all
>         </Limit>
> </Directory>
> 
> ScriptAlias /webpac-bin "/usr/local/etc/httpd2/webpac-bin"
> RewriteEngine on
> RewriteRule 
> /webpac-bin/wgbroker\?new\+-access\+top\.(icos|aipnbl) 
> http://libserv.aip.org:81/ipac20/ipac.jsp?profile=$1 [R=303,L]
> ~~~~~~~~~~~~~~~~~~~~~~~~
> 
> /webpac-bin is actually a symlink that points to another path, but all
> functionality/execution/permissions seem to be okay.  The only problem
> that I can determine is that the scripts being executed in /webpac-bin
> contain lots of SSIs, which I've heard can be problematic in rewrites
> and HTTP POSTs.
> 
> The problem I'm experiencing is that the only time the redirect works
> is when the query strings are left off.  So, anything after the
> question mark in teh URL seems to make the redirect not work, and I'm
> taken to the existing URL as if no rewrite rule existed.  If I take
> off the query strings in the initial URL, and specify a more general
> URL for the new URL in the rewrite rule, everything works, but the
> original query strings (?new+-access+top.icos) are tacked onto the new
> URL (e.g., http://sameserver:81?new+-access+top.icos).
> 
> What I'd like to do is have my initial rewrite rule work, where I can
> specify a the URLs I want to redirect users to in a more specific
> manner.  If not, I can settle for the more general URLs, but I'd like
> to at least strip off the trailing query strings
> (?new+-access+top.icos) after the redirect takes place.
> 
> Thanks for any help you can provide.
> 
> 
> 
> ---------------------------------------------------------------------
> 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@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
Diese E-mail ist eine private und persönliche Kommunikation. Sie hat
keinen Bezug zur Börsen- bzw. Geschäftstätigkeit der SWX Gruppe. This
e-mail is of a private and personal nature. It is not related to the
exchange or business activities of the SWX Group. Le présent e-mail est
un message privé et personnel, sans rapport avec l'activité boursière du
Groupe SWX.

This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please notify the sender urgently
and then immediately delete the message and any copies of it from your
system. Please also immediately destroy any hardcopies of the message.
You must not, directly or indirectly, use, disclose, distribute, print,
or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail
communications through their networks. Any views expressed in this
message are those of the individual sender, except where the message
states otherwise and the sender is authorised to state them to be the
views of the sender's company. 



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


Mime
View raw message