Re: headers_out vs err_headers_out with temporary redirect 302

2012-09-05 Thread Torsten Förtsch
ve them). === Yes, that's a bit misleading. The point is what exactly is an "error" here. I think what this statement means is that all of the internal redirect functions, that is ap_internal_redirect, ap_internal_redirect_handler and ap_internal_fast_redirect, contain code like

headers_out vs err_headers_out with temporary redirect 302

2012-09-04 Thread Anton Petrusevich
Hello, >From the doc: === The difference between headers_out and err_headers_out, is that the latter are printed even on error, and persist across internal redirects (so the headers printed for ErrorDocument handlers will have them). === It's still unclear to me what to use for temporary 302 r

Re: PerlAuthenHandler returns HTTP_UNAUTHORIZED (401) but Apache sends REDIRECT (302) and drops Set-Cookie and WWW-Authenticate header

2011-05-28 Thread Matisse Enzer
e > */ > >if (custom_response && custom_response[0] != '"') { > >if (ap_is_url(custom_response)) { >/* > * The URL isn't local, so lets drop through the rest of this > * apache code, and continue with the usual

Re: PerlAuthenHandler returns HTTP_UNAUTHORIZED (401) but Apache sends REDIRECT (302) and drops Set-Cookie and WWW-Authenticate header

2011-05-28 Thread Torsten Förtsch
/* * The URL isn't local, so lets drop through the rest of this * apache code, and continue with the usual REDIRECT handler. * But note that the client will ultimately see the wrong * status... */ r->status

PerlAuthenHandler returns HTTP_UNAUTHORIZED (401) but Apache sends REDIRECT (302) and drops Set-Cookie and WWW-Authenticate header

2011-05-28 Thread Matisse Enzer
RL that was set with $r->custom_response (see example below.) But: The response that Apache actually sends is a 302, without the 'Set-Cookie' or 'WWW-Authenticate' headers. Does setting a URL as the string (second argument) to custom_response force Apache to turn the resp

Re: Internal REDIRECT : $r->is_initial_req() false but $r->main() undef

2010-05-03 Thread Torsten Förtsch
On Monday 03 May 2010 14:53:23 Cédric Bertolini wrote: > Is there another way to access the main request ? > No, $r->main is the only way to get the main request. But an internal redirect is a different thing. It is not a subrequest. Hence $r->main is undef. You are looking for

Internal REDIRECT : $r->is_initial_req() false but $r->main() undef

2010-05-03 Thread Cédric Bertolini
Hi again, Subrequests are giving me a hard time :) I managed to use is_initial_req() in my PATH_INFO subrequests, thanks to your previous answer. But I ran into another subrequest : internal REDIRECT. My problem was that the subrequest gets a ResponseHandler call, this time, so I need to have it

Re: Redirect WTF

2010-01-27 Thread Adam Prime
David E. Wheeler wrote: On Jan 27, 2010, at 7:23 AM, Adam Prime wrote: This smells like a UseCanonicalName On + mod_dir redirect to me. If the directory /admin/profile/dest exists in the document root, there's a good chance it is. Ooh, thanks! I can see that I have mod_dir as a DSO

Re: 302 Redirect not working as expected with PerlCleanupHandler and Firefox under ModPerl::Registry

2010-01-27 Thread mackenna
Just wanted to note that since you've put the CONN_CLOSE in the redirect code, it's not necessary (nor desirable) to put "KeepAlive Off" in apache2.conf With the CONN_CLOSE call you turn KA off just when you need it to be off. So what's the bad news? cmac On

Re: Redirect WTF

2010-01-27 Thread David E. Wheeler
On Jan 27, 2010, at 7:23 AM, Adam Prime wrote: > This smells like a UseCanonicalName On + mod_dir redirect to me. If the > directory /admin/profile/dest exists in the document root, there's a good > chance it is. Ooh, thanks! I can see that I have mod_dir as a DSO, but I&#x

Re: Redirect WTF

2010-01-27 Thread Adam Prime
David E. Wheeler wrote: Fellow mod_perlers, Note that the hosthame is "benedict.local". Now I often just use localhost when using Bricolage, and most of the time that works fine. But there is one JavaScript-triggered redirect button that looks like this: window.location.href

Re: 302 Redirect not working as expected with PerlCleanupHandler and Firefox under ModPerl::Registry

2010-01-27 Thread Tosh Cooey
Would this problem be any different in a normal CGI context with the program doing forks? I don't imagine it would be, which is why I see the ultimate wisdom in spawning an external program to handle long-running tasks, or just cron something. Oh well, live and learn. Tosh William T wrote:

Re: 302 Redirect not working as expected with PerlCleanupHandler and Firefox under ModPerl::Registry

2010-01-27 Thread Tosh Cooey
push_handlers(PerlCleanupHandler => \&cleanup ); $r->err_headers_out->set(Location => 'http://...index.pl'); $r->status(Apache2::Const::REDIRECT); return Apache2::Const::REDIRECT; sub cleanup { my ($r) = @_; $r->warn("Starting cleanup"); foreac

Re: 302 Redirect not working as expected with PerlCleanupHandler and Firefox under ModPerl::Registry

2010-01-26 Thread mackenna
The warning from William T. made me think to ask: Does your site have "KeepAlive On" in httpd.conf? (If not I can't think of anything to suggest...) If so, try adding this as part of the redirect: use Apache2::Connection(); use Apache2::RequestRec(); ... my $c = $r->co

Re: 302 Redirect not working as expected with PerlCleanupHandler and Firefox under ModPerl::Registry

2010-01-26 Thread William T
Caveat Lector: Long Cleanups done inline on the Apache children can cause problems. If you get a situation where the CleanUp takes to long OR you get enough traffic to the page(s) which engage the CleanUp then you will encounter a tipping point, and soon after your website will be almost complete

Re: Redirect WTF

2010-01-26 Thread David E. Wheeler
On Jan 26, 2010, at 3:18 PM, Fred Moyer wrote: > I don't know if this could be an issue, but if I were to write this > config snippet, I would create a root block, and put the > transhandler outside that (with the other location based directives > inside). The transhandler isn't used in producti

Re: Redirect WTF

2010-01-26 Thread Fred Moyer
On Tue, Jan 26, 2010 at 2:58 PM, David E. Wheeler wrote: > Fellow mod_perlers, > > Here's a weird one for you. I'm testing Bricolage on mod_perl 2, getting it > ready for release, and noticed that some sort of redirect is happening when I > don't expec

Redirect WTF

2010-01-26 Thread David E. Wheeler
Fellow mod_perlers, Here's a weird one for you. I'm testing Bricolage on mod_perl 2, getting it ready for release, and noticed that some sort of redirect is happening when I don't expect it. To whit, I have this configuration: NameVirtualHost *:80 DocumentRoot

302 Redirect not working as expected with PerlCleanupHandler and Firefox under ModPerl::Registry

2010-01-26 Thread Tosh Cooey
nup ); $r->headers_out->set(Location => 'http://...index.pl'); $r->status(Apache2::Const::REDIRECT); return Apache2::Const::REDIRECT; sub cleanup { my ($r) = @_; $r->warn("Starting cleanup"); foreach my $num (1..5) { $r->warn("Number is $num&

redirect mod_perl install

2009-08-27 Thread megamic
Hi I was wondering how do I redirect the installation of mod_perl, as I dont have access to any system directories (eg /usr/apache2 etc.). I have seen suggestions that something like this might do it: perl Makefile.PL MP_APXS=/usr/apache2/bin/apxs PREFIX=$INSTDIR APACHE_PREFIX=$INSTDIR

Re: unreadable output after internal redirect

2009-08-21 Thread Mark Copper
ayed. ?If the > > URL contains a certain parameter, an internal redirect is issued: > > Can you provide what versions of mod_perl, apache, and perl you are using? Server: Apache/2.2.9 (Debian) mod_ssl/2.2.9 OpenSSL/0.9.8g mod_apreq2-20051231/2.6.0 mod_perl/2.0.4 Perl/v5.10.0 > &g

Re: unreadable output after internal redirect

2009-08-20 Thread Fred Moyer
On Thu, Aug 20, 2009 at 7:54 AM, Mark Copper wrote: > Hi, > > I have a Mason dhandler that generates an HTML page containing a form. > The action of the form is to get the same page that is displayed.  If the > URL contains a certain parameter, an internal redirect is issued: Can y

unreadable output after internal redirect

2009-08-20 Thread Mark Copper
Hi, I have a Mason dhandler that generates an HTML page containing a form. The action of the form is to get the same page that is displayed. If the URL contains a certain parameter, an internal redirect is issued: URL: mydomain.com/information/dhandler/variable.html?modification=update <%a

Re: PerlTransHandler Redirect (2.0)

2009-03-25 Thread David Stewart
Thanks Adam, I was pretty sure about returning the constant, but I didn't see where the location should go. Looks like err_headers_out works, thanks. -David Stewart On Mar 25, 2009, at 12:36 PM, Adam Prime wrote: David Stewart wrote: How do you replicate the redirect functionali

Re: PerlTransHandler Redirect (2.0)

2009-03-25 Thread Adam Prime
David Stewart wrote: How do you replicate the redirect functionality of mod_rewrite in a mod_perl 2 PerlTransHandler? I'm writing a PerlTransHandler to overcome some limitation of mod_rewrite and want to redirect requests to canonical URLs in some cases (e.g. replicate the functionali

PerlTransHandler Redirect (2.0)

2009-03-25 Thread David Stewart
How do you replicate the redirect functionality of mod_rewrite in a mod_perl 2 PerlTransHandler? I'm writing a PerlTransHandler to overcome some limitation of mod_rewrite and want to redirect requests to canonical URLs in some cases (e.g. replicate the functionality of the [R,L] fla

Re: Internal redirect inside an input filter

2008-10-09 Thread Dan DeSmet
Thanks for your help. Your confirmation led me to track down the real problem, which is that I marked the cookies secure, and forgot to do https rather than http in my browser URL. If not for your help, there's no telling how long I would've spent trying to fix a problem in my code that didn't ex

Re: Internal redirect inside an input filter

2008-10-09 Thread Torsten Foertsch
On Thu 09 Oct 2008, Dan DeSmet wrote: > I took your advice and tried switching it over to a TransHandler. >  Now, the beginning of the handler where I manipulate the cookies > looks like this: > > sub handler { >     my $r = shift; >     my $cookieString = $r->headers_in->get('Cookie'); >     ... >

Re: Internal redirect inside an input filter

2008-10-09 Thread Dan DeSmet
ttempting to write an input filter that performs an internal > > redirect based on the contents of the cookies sent in the request > > headers. > > Why an input filter? What you want is better done in a PerlTransHandler > or a PerlFixupHandler. > > Torsten > > -- > Need professional mod_perl support? > Just hire me: [EMAIL PROTECTED] >

Re: Internal redirect inside an input filter

2008-10-09 Thread Torsten Foertsch
On Thu 09 Oct 2008, Dan DeSmet wrote: > I'm attempting to write an input filter that performs an internal > redirect based on the contents of the cookies sent in the request > headers. Why an input filter? What you want is better done in a PerlTransHandler or a PerlFixupHan

Internal redirect inside an input filter

2008-10-09 Thread Dan DeSmet
I'm attempting to write an input filter that performs an internal redirect based on the contents of the cookies sent in the request headers. The problem I'm encountering is that the browser is receiving both the content for the original request, as well as the content generated by th

Re: [mp 2.0.4-dev] mod_perl segfaults httpd with simple CGI redirect

2007-11-21 Thread Perrin Harkins
On Nov 21, 2007 3:26 PM, David Eisner <[EMAIL PROTECTED]> wrote: > Second question: Is it a bug in mod_perl if referencing an old > Apache2::RequestRec object segfaults the server? It's certainly not desired behavior, but it's a tough thing to avoid. That code is providing access to Apache C struc

Re: [mp 2.0.4-dev] mod_perl segfaults httpd with simple CGI redirect

2007-11-21 Thread David Eisner
On Nov 21, 2007 12:19 PM, Perrin Harkins <[EMAIL PROTECTED]> wrote: > You need to pass $q to your sub every time. You can't just access it > directly from the enclosing scope. Thanks for the pointer. I'm reading Section 6.2 of the Practical mod_perl book now and I see what's going on. And I n

Re: [mp 2.0.4-dev] mod_perl segfaults httpd with simple CGI redirect

2007-11-21 Thread Perrin Harkins
t;new(); > handle_response(); > exit(0); > > > sub handle_response() { > $q->redirect( "http://slashdot.org"; ); > } You're creating a closure. The CGI object created on the first request gets stuck in your handle_response sub and tries to us

[mp 2.0.4-dev] mod_perl segfaults httpd with simple CGI redirect

2007-11-21 Thread David Eisner
s (but not the first) after restarting the server: use CGI qw/:standard/; use strict; my $q = CGI->new(); handle_response(); exit(0); sub handle_response() { $q->redirect( "http://slashdot.org"; ); } I'm accessing this at http:///mp/crash_me

Re: redirect

2007-10-17 Thread Perrin Harkins
page? Static HTML pages never set headers of any kind. > Through mozilla(Live HTTP Headers), we used to check the > location headers. Only redirects have a Location header. What is sending the redirect? > So we use this line to fetch the location header, > my $location = $r->header

Re: redirect

2007-10-16 Thread Mark Maunder
Hi, I may have missed some data earlier in this thread but, a few questions: It sounds like you're trying to use a mod_perl handler to read the location header from the client? Why are you doing this if your objective is to redirect the client to another page. Shouldn't you be sending

redirect

2007-10-16 Thread neelike
Hi Perrin Thanks for your reply. We are getting some responses from a html page and filtering the content accoding to our requirement. Through mozilla(Live HTTP Headers), we used to check the location headers. We need to redirect the location to some other page. we need to display the

RE: redirect

2007-10-10 Thread Eli Shemer
I don't know if it's any help to anyone but if it is, it seems the reason the usual redirect didn't work for me as it should, was due to screen output after the redirect command $r->headers_out->set(Location => '../index.pl'); $r->status(Apache2::Const::RE

Re: redirect

2007-10-06 Thread Perrin Harkins
ather send an OK signal since it's not an actual warning/error but a > valid redirect as part of the system. There's no reason to avoid using a normal redirect in this case. It's not an error and will not be written to the error_log. I'm not sure all browsers will hono

RE: redirect

2007-10-06 Thread Eli Shemer
$r->headers_out->set("Refresh"=>"0;url=index.pl"); $r->headers_out; return Apache2::Const::OK; this method seems to be the best solution for me since 1. it works 2. I rather send an OK signal since it's not an actual warning/error but a

Re: redirect

2007-10-06 Thread Issac Goldstand
Sounds like you're doing something not-quite-right... A 302 status code in conjunction with a Location header should immediately redirect to the URL in the Location header. If you'd rather, you can try sending a normal 200 (OK) response with an empty HTML page, and a Refresh header

RE: redirect

2007-10-06 Thread Eli Shemer
6:15 PM To: Eli Shemer Cc: modperl@perl.apache.org Subject: Re: redirect Send a Location: header back instead of a full response and return HTTP_MOVED_TEMPORARILY from your handler. If you want/need to return a response from the page, you can alternatively use an HTML META tag in the header to acco

Re: redirect

2007-10-06 Thread Issac Goldstand
n > the cookie is not taken into account yet(I have to refresh the main page > "again") > > > > One possible option might be porting Apache::Request::Redirect to > mod_perl2 but I wanted to hear more suggestions if possible. > > Preferrebly not using

redirect

2007-10-06 Thread Eli Shemer
is not taken into account yet(I have to refresh the main page "again") One possible option might be porting Apache::Request::Redirect to mod_perl2 but I wanted to hear more suggestions if possible. Preferrebly not using mod_rewrite or modifying any other apache configuration. Thanks all.

Re: mod_perl - Intercepting an external Redirect

2007-09-21 Thread Torsten Krah
Am Donnerstag, 20. September 2007 schrieben Sie: > On 9/19/07, Torsten Krah <[EMAIL PROTECTED]> wrote: > > Now i configured the "otherhost" to do a permanent redirect when > > /time/blog is requested. > > If i request this uri, the redirect is done like conf

Re: mod_perl - Intercepting an external Redirect

2007-09-20 Thread Torsten Krah
Perrin Harkins schrieb: On 9/19/07, Torsten Krah <[EMAIL PROTECTED]> wrote: Now i configured the "otherhost" to do a permanent redirect when /time/blog is requested. If i request this uri, the redirect is done like configured there - my filter does not get called. It

Re: mod_perl - Intercepting an external Redirect

2007-09-20 Thread Perrin Harkins
On 9/19/07, Torsten Krah <[EMAIL PROTECTED]> wrote: > Now i configured the "otherhost" to do a permanent redirect when /time/blog is > requested. > If i request this uri, the redirect is done like configured there - my filter > does not get called. It's possible

Re: mod_perl - Intercepting an external Redirect

2007-09-19 Thread Torsten Krah
Am Mittwoch, 19. September 2007 schrieb Perrin Harkins: > On 9/19/07, Torsten Krah <[EMAIL PROTECTED]> wrote: > > So in short, i need to analyze the response of mod_proxy and if it > > matches some criteria, i want to do a internal redirect and serve some > > cont

Re: mod_perl - Intercepting an external Redirect

2007-09-19 Thread Perrin Harkins
On 9/19/07, Torsten Krah <[EMAIL PROTECTED]> wrote: > So in short, i need to analyze the response of mod_proxy and if it matches > some criteria, i want to do a internal redirect and serve some content under > the requested url. > The client should not see the "externa

mod_perl - Intercepting an external Redirect

2007-09-19 Thread Torsten Krah
assed back to the client. In my case i need to intercept these response from mod_proxy and check if the response is a "redirect, code3xx" and the url got some prefix, say /extern. In this case i want to do a $r->internal_redirect which than would be handled again by the rewrite modul,

a bug with redirect in mod_perl-2.0.3 and CGI-3.25

2007-02-16 Thread Alexander V. Lukyanov
Hello! I have a perl script which uses CGI package and does redirect(). It is run under mod_perl. For some reason I get HTTP status "200 OK", but the header "Location:" is set and the response body says the document has moved. I have debugged it somewhat, found that send_cgi

Re: How do I redirect?

2006-12-11 Thread Philip M. Gollucci
Erik Norgaard wrote: Hi: I was wondering: How do I redirect to a different page? I want my handler to be able to redirect a request, I know there is the REDIRECT constant but I also need to indicate where to? This doesn't seem to be in the man-page. Thanks, Erik Source Code:

How do I redirect?

2006-12-11 Thread Erik Norgaard
Hi: I was wondering: How do I redirect to a different page? I want my handler to be able to redirect a request, I know there is the REDIRECT constant but I also need to indicate where to? This doesn't seem to be in the man-page. Thanks, Erik -- Ph: +34.666334818

Re: Transhandler? Redirect permanent?

2006-10-25 Thread Tyler MacDonald
Will Fould <[EMAIL PROTECTED]> wrote: > I've started testing a handler (configured at '/') that parses $r->uri and > checks the object, doing a redirect accordingly, but this seems wasteful for > every hit. > I've thought about using the handler for only

Re: Transhandler? Redirect permanent?

2006-10-25 Thread Jonathan
On Oct 25, 2006, at 9:48 PM, Will Fould wrote: I've started testing a handler (configured at '/') that parses $r- >uri and checks the object, doing a redirect accordingly, but this seems wasteful for every hit. I've thought about using the handler for only 404...

Transhandler? Redirect permanent?

2006-10-25 Thread Will Fould
(MP2-Apache2)I have a fast growing number of virtual (non-existant) subdirectories under document root:   /apple   /foo   /grape   /bareach one corresponds to a dynamic document. Until now, I've just used:   Redirect permanent /apple http://www.example.com/content.cgi?content=apple ...

'error-notes' has no value on errordocument redirect (patch included)

2006-08-16 Thread Guy Albertelli II
-8<-- Start Bug Report 8<-- 1. Problem Description: $r->prev->notes->{'error-notes'} exists but is blank on an error document redirect. This patch appears to fix it: --- modperl_callback.c.orig 2006-08-16

external redirect after internal redirect not working

2006-06-22 Thread Michael Greenish
my config so that all scripts run as handlers but I am still having the same problem: 1. redirect from normal request works fine 2. redirect from internal redirect results in a '302 result' although I am using the same code for each. The concept is as follows: http request w/ posted da

Re: mod_perl 2.0 - redirect

2006-04-06 Thread Torsten Foertsch
On Thursday 06 April 2006 13:52, Graf László wrote: > $r->internal_redirect("/wimap/index.html"); you are redirecting to yourself. > return Apache2::Const::OK; > } > > 1; ... > >> LoadModule perl_module modules/mod_perl.so > >> PerlRequire /usr/local/apache2/conf/mod_perl/imap_start.pl > >> thi

Re: mod_perl 2.0 - redirect

2006-04-06 Thread Graf László
The module's source: #file:Wimap/Wimap.pm #-- package Wimap::Wimap; use strict; use warnings; use Apache2::Const -compile => qw(OK); use Apache2::Log; use Apache2::RequestIO (); use Apache2::RequestRec (); use Apache2::RequestUtil (); use Apache2::ServerRec (); use Apache2::

Re: mod_perl 2.0 - redirect

2006-04-06 Thread Sean Davis
I think it would help if you could give some more information (like how you are writing the index.html file). Some code? Sean On 4/6/06 7:32 AM, "Graf László" <[EMAIL PROTECTED]> wrote: > Hi all, > > I made a mod_perl 2.0 module that connects to an IMAP server, > retrieves the undeleted mails

mod_perl 2.0 - redirect

2006-04-06 Thread Graf László
Hi all, I made a mod_perl 2.0 module that connects to an IMAP server, retrieves the undeleted mails and generates HTML output. OK, it works fine. When I access 'http://localhost/wimap', the module generates the content and displays it. But what if I want to write the output into a file in the A

[MP2] Terminate / Redirect request in Input Filter

2006-03-30 Thread Alex
strator of that system for details. Content preview: Hi, following scenario: - mod_perl2 Apache2 Input Filter - stream based - regex checks some stuff in GET/POST args + Referer - if it finds something -> log it -> terminate / redirect request [...] Content analysis details: (6.1 points

Re: [mp1] redirect in ErrorDocument

2006-03-23 Thread Carl Johnstone
> > Yet enabling "PerlSendHeader On" and doing: > > > > print "Location: $newurl\n\n"; > > > > works fine. > > What are the complete headers that sends? I'm guessing it sends a 200 > status and it only works because your browser i

Re: external redirect after internal redirect not working

2006-03-22 Thread Geoffrey Young
Tom Schindl wrote: > Hi Geoff, > > Geoffrey Young wrote: > >>Tom Schindl wrote: >> >> >>>This means the when the documentation holds information about situation >>>where one has to use $r->status(), I would propose that in should add >>>the use case of filters. >>> >>>This has nothing TODO with

Re: external redirect after internal redirect not working

2006-03-22 Thread Jonathan Vanasco
On Mar 22, 2006, at 2:49 PM, Michael Greenish wrote: It's been a while since I set up the server but I think I did it because setting up the apache config file was easier. And the redirect works under normal circumstances, but not when coming from an internal redirect. What is the diffe

Re: external redirect after internal redirect not working

2006-03-22 Thread Tom Schindl
Hi Geoff, Geoffrey Young wrote: > > Tom Schindl wrote: > >>This means the when the documentation holds information about situation >>where one has to use $r->status(), I would propose that in should add >>the use case of filters. >> >>This has nothing TODO with your problem I only wanted to poin

Re: external redirect after internal redirect not working

2006-03-22 Thread Geoffrey Young
; not all cases where setting $r->status manually are documented there. you really should never alter $r->status, as apache uses it for internal bookeeping... except for registry scripts :) for registry scripts $r->status is a hack way of telling registry to 'return REDIRECT' since

Re: external redirect after internal redirect not working

2006-03-22 Thread Tom Schindl
> > It's been a while since I set up the server but I > think I did it because setting up the apache config > file was easier. And the redirect works under normal What's the big deal, in my idea Registry is only helpful if you want to speed up your CGI-Scripts not for ne

Re: external redirect after internal redirect not working

2006-03-22 Thread Michael Greenish
problem. > > Tom > It's been a while since I set up the server but I think I did it because setting up the apache config file was easier. And the redirect works under normal circumstances, but not when coming from an internal redirect. What is the difference? Is there

Re: external redirect after internal redirect not working

2006-03-22 Thread Tom Schindl
rry Tom, but I don't understand your response. > > > thanks, > > greanie > > --- Tom Schindl <[EMAIL PROTECTED]> wrote: > > >>Fred Moyer wrote: >> >>>Michael Greenish wrote: >>> >>>>use strict; >>> >>>[..]

Re: external redirect after internal redirect not working

2006-03-22 Thread Michael Greenish
hanks, greanie --- Tom Schindl <[EMAIL PROTECTED]> wrote: > Fred Moyer wrote: > > Michael Greenish wrote: > >> use strict; > > [..] > > > >> # redirect > >> $r->headers_out->set( Location => $redirectURL ); > >> $r->status( RE

Re: external redirect after internal redirect not working

2006-03-22 Thread Tom Schindl
Fred Moyer wrote: > Michael Greenish wrote: >> use strict; > [..] > >> # redirect >> $r->headers_out->set( Location => $redirectURL ); >> $r->status( REDIRECT ); > >> return REDIRECT; > > I see a few things here that catch my eye but w

Re: external redirect after internal redirect not working

2006-03-22 Thread Fred Moyer
Michael Greenish wrote: > use strict; [..] # redirect $r->headers_out->set( Location => $redirectURL ); $r->status( REDIRECT ); > return REDIRECT; I see a few things here that catch my eye but what stands out the most is the use of the same return code for the browser an

external redirect after internal redirect not working

2006-03-21 Thread Michael Greenish
Hello, I am attempting an external redirect after an internal redirect and it isn't working. Below are code excerpts: use strict; use DBI; use Apache2::RequestRec(); use APR::Table(); use CGI; $CGI::POST_MAX=1024 * 1024; # max 1M posts $CGI::DISABLE_UPLOADS = 0; # change to 1 to di

Re: [mp1] redirect in ErrorDocument

2006-03-17 Thread Perrin Harkins
fine. What are the complete headers that sends? I'm guessing it sends a 200 status and it only works because your browser is broken and follows the redirect anyway. - Perrin

Re: [mp1] redirect in ErrorDocument

2006-03-17 Thread Tom Schindl
Not sure but give err_headers_out a try? Tom Carl Johnstone wrote: > > In an Apache::Registry ErrorDocument (e.g. ErrorDocument 404 /my404.pl ) > > This doesn't work: > > $r->header_out('Location', $newurl); > $r->status(302); > return OK; > > > Apache returns an error saying that my 404

[mp1] redirect in ErrorDocument

2006-03-17 Thread Carl Johnstone
In an Apache::Registry ErrorDocument (e.g. ErrorDocument 404 /my404.pl ) This doesn't work: $r->header_out('Location', $newurl); $r->status(302); return OK; Apache returns an error saying that my 404 handler returned a 302 error. Does the same if I use err_header_out Yet enabling "Perl

Re: Re: Modperl2 + PerlAccessHandler + Redirect

2006-03-10 Thread yperl
Hi All! Thanks for your suggestions. Here is the solution: # set the location $r->headers_out->set( Location => $CONFIG->{ACCESS_DENIED} ); return Apache2::Const::REDIRECT; Regards, Younes Message d'origine >Copie à: modperl_users List >De: Jonathan Vanasco <

Re: Modperl2 + PerlAccessHandler + Redirect

2006-03-09 Thread Jonathan Vanasco
Tom's suggestion made me realize the obvious flaw in the code that neither of us saw. header_out doesn't exist in the api. headerS_out does. Try: $r->headers_out( Location => 'http://www.google.fr' ); not: $r->header_out( Location => 'http://www.google.fr' ); On

Re: Modperl2 + PerlAccessHandler + Redirect

2006-03-09 Thread Jonathan Vanasco
On Mar 9, 2006, at 6:13 PM, yperl wrote: sub handler { my $r =shift; # tell the client what's coming $r->content_type('text/html'); # set the location $r->header_out( Location => 'http://www.google.fr' ); return Apache2::Const::REDIRECT; }

Re: Modperl2 + PerlAccessHandler + Redirect

2006-03-09 Thread Tom Schindl
If that's not working I'd give err_headers_out_ a try: http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_err_headers_out_ Tom yperl wrote: > Hi All! > > I would like to do a redirect from a PerlAccessHandler. > With mod_perl1 to below code works. > But how

Modperl2 + PerlAccessHandler + Redirect

2006-03-09 Thread yperl
Hi All! I would like to do a redirect from a PerlAccessHandler. With mod_perl1 to below code works. But how to achieve the same thing with mod_perl2? sub handler { my $r =shift; # tell the client what's coming $r->content_type('text/html'); # set the location $r->

Re: [OT] Re: modifying the query string & uri without a redirect ?

2005-12-24 Thread Jonathan Vanasco
(OT) Ah. Very odd. I misinterpreted the NS flag I had: RewriteRule ^/users/([\d]{1,9})$ /users/?id=$1 [QSA,L] Now I have RewriteRule ^/users/([\d]{1,9})(/)?$ /users/?id=$1 [QSA,NS,L] And it all works fine. I realized that I wasn't seeing an actual redirect, bu

[OT] Re: modifying the query string & uri without a redirect ?

2005-12-24 Thread John ORourke
your query string for you. If you have collisions with the 'id' parameter I'd suggest changing your program logic - HTTP doesn't strongly define parameter ordering or precedence so you might get unexpected results! mod_rewrite only does an external redirect (so users see

modifying the query string & uri without a redirect ?

2005-12-23 Thread Jonathan Vanasco
Currently a page is accessed like this: /user/profile?id=X I'm trying to get url schemes like this to map to that page /users/X /users/X/profile I tried doing it in mod_rewrite. there i ran into 2 problems: a_ the new mapping is shown to the user b_ i can eithe

Re: no cookie on redirect : mod_auth_tkt2

2005-08-15 Thread Marc Lambrichs
y $value = $cookie->value; my $path = $cookie->path; return < EOT } Clearly, there must be a better (nicer) way to do this, don't you think? Regards, Marc James Smith wrote: Marc, You will need to get the cookie sent back to the browser, if you redirect to a URL with no

Re: no cookie on redirect : mod_auth_tkt2

2005-08-14 Thread James Smith
Marc, You will need to get the cookie sent back to the browser, if you redirect to a URL with no domain in it - Apache "cleverly" notices this and performs the second request without going back to the browser. To force return to the browser include the domain in the URL $r->hea

no cookie on redirect : mod_auth_tkt2

2005-08-14 Thread Marc Lambrichs
I'm trying to build a mp2 handler to login using mod_auth_tkt2. I like the idea of probing if the client can support cookies, so tried to rebuild it. According to the cgi example there is some problem with setting the cookie on a redirect. The same problem - no probe cookie is set durin

Re: redirect doesn't work in eval

2005-08-08 Thread Philip M. Gollucci
Marc Lambrichs wrote: When a request is sent to the webserver, it handles some stuff and then - sometimes - a redirect must take place. Now the weird part: when i use $r->headers_out->set( Location => 'http://www.mysite.com/' ); return Apache2::Const::REDIRECT inside an eva

redirect doesn't work in eval

2005-08-08 Thread Marc Lambrichs
When a request is sent to the webserver, it handles some stuff and then - sometimes - a redirect must take place. Now the weird part: when i use $r->headers_out->set( Location => 'http://www.mysite.com/' ); return Apache2::Const::REDIRECT inside an eval{} construction it doe

Re: what is the equivalent for CGI->redirect()?

2005-06-22 Thread Philippe M. Chiasson
Foo Ji-Haw wrote: > Hi guys, > > I used to use CGI->redirect, but what is the requivalent for modperl2? Set the 'Location:' header and return a REDIRECT return code use Apache2::Const -compile => qw(REDIRECT); # Same as HTTP_MOVED_TEMPORARILY my $location = "

what is the equivalent for CGI->redirect()?

2005-06-22 Thread Foo Ji-Haw
Hi guys, I used to use CGI->redirect, but what is the requivalent for modperl2? thanks.

Re: [MP2] : REDIRECT_ERROR_NOTES not set on errordocument redirect

2005-05-23 Thread Stas Bekman
Mark wrote: [...] Could it possibly come from here? src/modules/perl/modperl_callback.c if (status == HTTP_INTERNAL_SERVER_ERROR) { if (r && r->notes) { apr_table_set(r->notes, "error-notes", SvPV_nolen(ERRSV)); } } And we should check whether error-notes is

Re: [MP2] : REDIRECT_ERROR_NOTES not set on errordocument redirect

2005-05-22 Thread Mark
Stas Bekman wrote: Mark wrote: Stas Bekman wrote: Mark wrote: -8<-- Start Bug Report 8<-- 1. Problem Description: $ENV{REDIRECT_ERROR_NOTES} not working with MP2 Using latest everything (modperl 2 RC5). To illustrate, I simply configure Apache wit

Re: [MP2] : REDIRECT_ERROR_NOTES not set on errordocument redirect

2005-05-12 Thread Stas Bekman
Mark wrote: Stas Bekman wrote: Mark wrote: -8<-- Start Bug Report 8<-- 1. Problem Description: $ENV{REDIRECT_ERROR_NOTES} not working with MP2 Using latest everything (modperl 2 RC5). To illustrate, I simply configure Apache with an errordocument: ErrorDoc

Re: [MP2] : REDIRECT_ERROR_NOTES not set on errordocument redirect

2005-05-10 Thread Mark
Stas Bekman wrote: Mark wrote: -8<-- Start Bug Report 8<-- 1. Problem Description: $ENV{REDIRECT_ERROR_NOTES} not working with MP2 Using latest everything (modperl 2 RC5). To illustrate, I simply configure Apache with an errordocument: ErrorDocument 500 /c

Re: [MP2] : REDIRECT_ERROR_NOTES not set on errordocument redirect

2005-05-10 Thread Mark
Stas Bekman wrote: Mark wrote: -8<-- Start Bug Report 8<-- 1. Problem Description: $ENV{REDIRECT_ERROR_NOTES} not working with MP2 Using latest everything (modperl 2 RC5). To illustrate, I simply configure Apache with an errordocument: ErrorDocument 500 /c

Re: [MP2] : REDIRECT_ERROR_NOTES not set on errordocument redirect

2005-05-03 Thread Stas Bekman
Mark wrote: -8<-- Start Bug Report 8<-- 1. Problem Description: $ENV{REDIRECT_ERROR_NOTES} not working with MP2 Using latest everything (modperl 2 RC5). To illustrate, I simply configure Apache with an errordocument: ErrorDocument 500 /cgi/printenv I have

  1   2   >