httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clay Redding <c...@monarchos.com>
Subject [users@httpd] Rewrite or redirect difficulties with CGI query parameters
Date Thu, 22 Jan 2004 20:37:15 GMT
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

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


Mime
View raw message