Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"Location: /something.html" don't work in IIS 3.0 Please help!!!!

0 views
Skip to first unread message

Paul-Catalin Oros

unread,
Jan 8, 1997, 3:00:00 AM1/8/97
to

Hi,

I'm trying to create a CGI Perl script for an IIS 3.0 server, but even the
most basic commands create problems for IE 3.0 and Netscape Navigator 3.0.
The code I wrote is:

print "Location: /order.html\n\n";

In IE 3.0 the result is a page with:

Location: /order.html

Netscape always asks me to save the file.

If anybody have at least an idea about what the problem could be, please
reply as soon as possible here and at my EMail address:
pa...@integration.qc.ca

Thank you!

Paul


Adrian Bateman

unread,
Jan 9, 1997, 3:00:00 AM1/9/97
to

If you are using the Perl ISAPI extension, you must treat Perl scripts as
non-parsed header scripts and write out the correct HTTP response e.g.
HTTP/1.0 200 OK or HTTP/1.0 302 Moved.

For more info, see the FAQ pointed to in the Perl ISAPI docs.

Ade.

Paul-Catalin Oros <pa...@integration.qc.ca> wrote in article
<01bbfddd$d41d4b70$11f6eccd@arrakis>...

Chris DeCoro

unread,
Jan 9, 1997, 3:00:00 AM1/9/97
to


Paul-Catalin Oros <pa...@integration.qc.ca> wrote in article
<01bbfddd$d41d4b70$11f6eccd@arrakis>...
> Hi,
>
> I'm trying to create a CGI Perl script for an IIS 3.0 server, but even
the
> most basic commands create problems for IE 3.0 and Netscape Navigator
3.0.
> The code I wrote is:
>
> print "Location: /order.html\n\n";
>
> In IE 3.0 the result is a page with:
>
> Location: /order.html
>

Here's the reason: the URL cannot be relative - it has to do with HTTP
being a stateless protocol. Make sure that you include a complete URL to
the document. If you don't want to have to include the sever name in the
program (although it's interpreted so it wouldn't be hard to change) use
the SERVER_NAME variable. Also, make sure that you return a redirection
header (301 or 302 will work) instead of a 200 OK.

Hope it helped!
-- Chris...@activelabs.com

Simon Fell

unread,
Jan 10, 1997, 3:00:00 AM1/10/97
to

On Wed, 08 Jan 1997 20:35:48 -0800, "Paul-Catalin Oros"
<pa...@integration.qc.ca> wrote:

>Hi,
>
>I'm trying to create a CGI Perl script for an IIS 3.0 server, but even the
>most basic commands create problems for IE 3.0 and Netscape Navigator 3.0.
>The code I wrote is:
>
>print "Location: /order.html\n\n";
>
>In IE 3.0 the result is a page with:
>
>Location: /order.html
>

>Netscape always asks me to save the file.
>
>If anybody have at least an idea about what the problem could be, please
>reply as soon as possible here and at my EMail address:
>pa...@integration.qc.ca
>
>Thank you!
>
> Paul
>

You need to send the standard http headers first so that Netscape
knows its a html document. IE is more forgiving of missing bits

try

print "HTTP/1.0 200 OK\n";
print "Content-type: text/html\n\n";
print "<HTML><HEAD></HEAD>" ;


print "Location: /order.html\n\n";

If you need any more info you may want to look at some of the perl/cgi
newsgroups
comp.lang.perl.misc
comp.infosystems.www.authoring.cgi

ttfn
Simon Fell

Paul Oros

unread,
Jan 10, 1997, 3:00:00 AM1/10/97
to

Hi,

Thank you for your reply. I finaly got it to work in IE 3.0, but now I
have problems under Netscape Navigator Gold 3.0 The code I use is:

print "HTTP/1.0 303 See OtherOK\n";
print <<"END";

Content-type: text/html
Location: www.server.com/page.html

END

This works well in IE 3.0 but I can't get it to work in Navigator. It
would be great if somebody could post just a few lines of Perl code that
works for Navigator also.

Regards,


Paul

Adrian Bateman wrote:
>
> If you are using the Perl ISAPI extension, you must treat Perl scripts as
> non-parsed header scripts and write out the correct HTTP response e.g.
> HTTP/1.0 200 OK or HTTP/1.0 302 Moved.
>
> For more info, see the FAQ pointed to in the Perl ISAPI docs.
>
> Ade.
>

> Paul-Catalin Oros <pa...@integration.qc.ca> wrote in article
> <01bbfddd$d41d4b70$11f6eccd@arrakis>...

Web Master

unread,
Jan 15, 1997, 3:00:00 AM1/15/97
to

Paul Oros wrote:
>
> Hi,

>
>
> This works well in IE 3.0 but I can't get it to work in Navigator. It
> would be great if somebody could post just a few lines of Perl code that
> works for Navigator also.
>
> Regards,
> Paul

Try this:

if ($ENV{'SERVER_SOFTWARE'} eq
'Microsoft-Internet-Information-Server/1.0')
{
print "status: 301 Document Moved\n";
print "Location: http://blah.blah.blah/foo.html\n\n";
}
else
{
print "HTTP/1.0 301 Document Moved\n";
print "Location: http://blah.blah.blah/scripts/foo.pl\n\n";
}

0 new messages