List Info

Thread: redirect before headers are sent




redirect before headers are sent
user name
2007-11-28 00:25:59
This is related to Bricolage by proximity, because I have to

authenticate on an IIS machine, and redirect to an Apache
server. On the 
  Apache server I have to check for a cookie and either
redirect to the 
IIS server or load a page. The pages are all built by
Bricolage. Mason 
is not available on the Apache server, but Mod Perl is.

The Problem:

I can't find a way to get a cgi script to read a cookie and
redirect by 
using <!--#include virtual or <!--exec cgi, both seem
to be loaded after 
the headers are sent. Does anyone have an idea of how to do
this?

Hmm,... would putting the directive first in the body work?
Or would Javascript be a better way to go? Or is there a
mod_perl module 
that would do it?

TIA

gh


RE: redirect before headers are sent
user name
2007-11-28 05:04:11
I think you can use mod_rewrite to check for the presence of
specific cookies and that will be your most bullet proof
solution.

This page provides examples:

http://www.askapache.com/htaccess/htaccess-fres
h.html#modrewrite2


I don't believe server side includes will afford you any
opportunity to set HTTP headers since SSIs are inserted into
page content, not responsible for handling / controlling the
request itself.

mod_rewrite would be your most bullet proof solution if you
can get it to work.

-----Original Message-----
From: George Harrison [mailto:gharriscentauri.mb.ca]
Sent: Wed 11/28/2007 1:25 AM
To: userslists.bricolage.cc
Subject: redirect before headers are sent
 
This is related to Bricolage by proximity, because I have to

authenticate on an IIS machine, and redirect to an Apache
server. On the 
  Apache server I have to check for a cookie and either
redirect to the 
IIS server or load a page. The pages are all built by
Bricolage. Mason 
is not available on the Apache server, but Mod Perl is.

The Problem:

I can't find a way to get a cgi script to read a cookie and
redirect by 
using <!--#include virtual or <!--exec cgi, both seem
to be loaded after 
the headers are sent. Does anyone have an idea of how to do
this?

Hmm,... would putting the directive first in the body work?
Or would Javascript be a better way to go? Or is there a
mod_perl module 
that would do it?

TIA

gh



RE: redirect before headers are sent
user name
2007-11-28 15:05:38
Beaudet, David P. <mailto-Beaudet
NGA.GOV> wrote on November 28, 2007
05:04 AM:

> I think you can use mod_rewrite to check for the
presence of specific
> cookies and that will be your most bullet proof
solution. 

Yes, I looked at that and it seemed a bit scary, but I live
for the
thrills anyway.
> 
> This page provides examples:
> 
> http://www.askapache.com/htaccess/htaccess-fres
h.html#modrewrite2
> 
> 

The trouble with documentation like this is that the people
who write it
long ago forgot how to be confused.


> I don't believe server side includes will afford you
any opportunity
> to set HTTP headers since SSIs are inserted into page
content, not
> responsible for handling / controlling the request
itself. 

That's what I found. 
> 
> mod_rewrite would be your most bullet proof solution if
you can get
> it to work. 

So off I go to try it.

Thanks for the pointer.

gh
> 
> -----Original Message-----
> From: George Harrison [mailto:gharriscentauri.mb.ca]
> Sent: Wed 11/28/2007 1:25 AM
> To: userslists.bricolage.cc
> Subject: redirect before headers are sent
> 
> This is related to Bricolage by proximity, because I
have to
> authenticate on an IIS machine, and redirect to an
Apache server. On
>   the Apache server I have to check for a cookie and
either redirect
> to the 
> IIS server or load a page. The pages are all built by
Bricolage. Mason
> is not available on the Apache server, but Mod Perl
is.
> 
> The Problem:
> 
> I can't find a way to get a cgi script to read a cookie
and redirect
> by 
> using <!--#include virtual or <!--exec cgi, both
seem to be loaded
> after 
> the headers are sent. Does anyone have an idea of how
to do this?
> 
> Hmm,... would putting the directive first in the body
work?
> Or would Javascript be a better way to go? Or is there
a mod_perl
> module 
> that would do it?
> 
> TIA
> 
> gh


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )