Apache Server configuration support - HTTP redirect from output filter

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > May 2006 > HTTP redirect from output filter





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author HTTP redirect from output filter
Andy Buckley

2006-05-25, 1:25 am

Hi,

Not *exactly* configuration, but definitely an Apache 2 issue, so here
goes...

I've got an HTML output filter defined via mod_ext_filter, which puts,
among other things, a site-wide navigation bar at the top of each page
on the site. I'm adding a drop-down list of sub-sites to this bar and
would like to have the form submit handler redirect the browser to the
appropriate sub-site. Rather than have an external CGI or similar to
handle the redirect, I'd like to build this into the filter, so that it
redirects itself if a query string variable is defined.

However, the HTTP headers are separated from the filter input before
processing, so simply writing a "Location: /foo\n\n" line at the head
of the filter output doesn't produce the desired redirect. Is there
some way that I can use the filter to affect the HTTP headers, or will
I have to resort to the less elegant external CGI method to do the
redirect?

Thanks,
Andy

Robert Ionescu

2006-05-25, 7:19 am

Andy Buckley wrote:
> so that it
> redirects itself if a query string variable is defined.


Why don't you use mod_rewrite to check the QueryString in your
httpd.conf/virtual host?

--
Robert
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com