Re: Redirecting internally
Re: Redirecting internally
- Subject: Re: Redirecting internally
- From: Eric Stewart <email@hidden>
- Date: Thu, 21 Jul 2005 23:18:51 -0400
I actually got the redirect to operate with RedirectMatch, but it's an
external redirect and all the scripts that are accessing the
application fail on an external redirect. So I have to do an internal
redirect with is completely transparent to the client.
I appreciate you help though.
On 7/21/05, Galen Rhodes <email@hidden> wrote:
> If you're working with Apache you could also use Apache's
> RedirectMatch statement.
>
> http://httpd.apache.org/docs/mod/mod_alias.html#redirectmatch
>
> To have Apache redirect a URL like "/users/grhodes" to a DA request
> like "/cgi-bin/WebObjects/SomeApp.woa/wa/viewUser?user=grhodes" you
> would add this to Apache's config file.
>
> RedirectMatch ^/users/(.+)$ /cgi-bin/WebObjects/SomeApp.woa/wa/
> viewUser?user=$1
>
> In YOUR case it would look something like this:
>
> RedirectMatch ^/cgi-bin/script.cgi?(.+)$ /cgi-bin/WebObjects/
> Script.woa/wa/action?$1
>
>
>
> On Jul 21, 2005, at 10:02 PM, Zak Burke wrote:
>
> > Eric Stewart wrote on 7/21/05 5:19 PM:
> >
> >> I'm currently converting a script originally in cgi to WO. The server
> >> gets requests something similar to this
> >> http://www.example.com/cgi-bin/script.cgi?a=1&b=2.
> >>
> >> I need that to be internally redirected to
> >> http://www.example.com/cgi-bin/WebObjects/Script.woa/wa/action?
> >> a=1&b=2
> >>
> >
> > bounce the browser from the CGI to the WO page:
> >
> > #!/usr/local/bin/perl
> > print "Location: http://...wa/action?$ENV{'QUERY_STRING'}\n\n";
> >
> >
> > or grab content from the new page, but display it as though
> > http://www.example.com/cgi-bin/script.cgi?a=1&b=2 itself generated the
> > content:
> >
> > #!/usr/local/bin/perl
> >
> > use strict;
> > use LWP;
> >
> > main();
> >
> > sub main
> > {
> >
> > print "Content-type: text/html\n\n";
> >
> > my $ua = LWP::UserAgent->new();
> > my $url = "http://.../Script.woa/wa/action?$ENV{'QUERY_STRING'}";
> > my $res = $ua->get($url);
> > if ( $res->is_success ) {
> >
> > print $res->content;
> >
> > } else {
> >
> > print "ERROR retrieving $url: " . $res->status_line();
> >
> > }
> > }
> >
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > Do not post admin requests to the list. They will be ignored.
> > Webobjects-dev mailing list (email@hidden)
> > Help/Unsubscribe/Update your Subscription:
> > 40thissmallworld.com
> >
> > This email sent to email@hidden
> >
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden