[Xitami] CGI header access?

Francis Turner francis.turner at gmail.com
Sat Aug 9 14:24:52 CEST 2008


Quick answer: YES

in fact I tested it and so long as you have not printed ANYTHING
before the redirect it will work. i.e. starting your CGI function with
code similar to
if (domain == "thisdomain.com") {
print "Status: 301 Moved Permanently\nLocation: http://otherdomain.com/\n\n";
exit;
}
works just fine

On Sat, Aug 9, 2008 at 1:56 PM, Phillip C. Wilson <wilson at wha.com> wrote:
> I've been using Xitami since 2000 and am reluctant to change web servers
> 'cause everything has worked perfectly.
>
> I have a CGI exe as my default "page" which builds dynamic pages for me,
> HTML only no HTTP headers.
>
> I want to make a change in that for some domains I want that same CGI to
> issue a 3-line redirection - just issue HTTP headers and no HTML (bringing
> it back to the same server but with a different name and it has to be a 301
> Redirection):
>
> Writeln('HTTP/1.0 301 Moved Permanently');
> Writeln('Location: http://NewDomain.com/page1.htm');
> Writeln('');
> Question(s):  Can I simply put this code in the same default CGI?  Do CGIs
> handle headers?  If not, is there another way to issue a redirection? A
> redirection under program control?
>
> Thanks.
>
>
>
> --
> Xitami Users Mailing List -- For Xitami support
> To unsubscribe: http://lists.xitami.org/mailman/listinfo/xitami
>



-- 
http://www.di2.nu/blog.htm
Faber's Fourth Law:
 Necessity is the mother of strange bedfellows.


More information about the Xitami mailing list