RE: Wierd problem with redirect

2000-06-01 Thread Doug MacEachern

On Wed, 31 May 2000, Jeffrey W. Baker wrote:

 On Tue, 30 May 2000, Jerrad Pierce wrote:
 
  I'm running into an odd redirect ptoblem myself, I'm issuing:
  
  HTTP/1.1 302 Moved Temporarily\n\r
  Date: Tue 30 May 2000 18:18:07 GMT\n\r
  Server: Apache/1.311\n\r
  Set-Cookie: SESSION_ID=4177a0c9ae2b278decd6038901b28a2a; path=/;
  expires=Thu, 1-Jan-70 00:20:00 GMT;\n\r
  Location: /\n\r
 
 If you don't follow the HTTP specification, you can't expect the browser
 to do the right thing.  "/" is not a valid URI for a Location.  According
 to RFC 2616, the Location must be an absolute URI:

but it is valid in apache, for mod_cgi scripts and mod_perl scripts that
have PerlSendHeader On.  apache will do an internal redirect if the url is
not absolute.




Fw: Re: Wierd problem with redirect

2000-05-31 Thread serg gajdajchuk


-Original Message-
From: Eric Cholet [EMAIL PROTECTED]
To: ___cliff rayman___ [EMAIL PROTECTED]
Date: Tue, 30 May 2000 23:57:13 +0200
Subject: Re: Wierd problem with redirect

 On Tue, May 30, 2000 at 02:30:36PM -0700, ___cliff rayman___ wrote:
  actually \n\r\ is really how it is supposed to be.
  i am sure you will find it in the RFC's.
  most browsers seem to be okay with \n's only.
 
 Actually it's \r\n, unless you're on a Mac :-)
 
 -- 
 Eric Cholet
 
 



RE: Wierd problem with redirect

2000-05-31 Thread Jeffrey W. Baker

On Tue, 30 May 2000, Jerrad Pierce wrote:

 I'm running into an odd redirect ptoblem myself, I'm issuing:
 
 HTTP/1.1 302 Moved Temporarily\n\r
 Date: Tue 30 May 2000 18:18:07 GMT\n\r
 Server: Apache/1.311\n\r
 Set-Cookie: SESSION_ID=4177a0c9ae2b278decd6038901b28a2a; path=/;
 expires=Thu, 1-Jan-70 00:20:00 GMT;\n\r
 Location: /\n\r

If you don't follow the HTTP specification, you can't expect the browser
to do the right thing.  "/" is not a valid URI for a Location.  According
to RFC 2616, the Location must be an absolute URI:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30

In RFC 2396, an absolute URI is defined as:

absoluteURI   = scheme ":" ( hier_part | opaque_part )

So your method is not valid, and you deserve whatever the browser does to
you.  You should do this instead:

Location: http://mysite.com/\n\r

Regards,
Jeffrey




RE: Wierd problem with redirect

2000-05-30 Thread Jerrad Pierce

I'm running into an odd redirect ptoblem myself, I'm issuing:

HTTP/1.1 302 Moved Temporarily\n\r
Date: Tue 30 May 2000 18:18:07 GMT\n\r
Server: Apache/1.311\n\r
Set-Cookie: SESSION_ID=4177a0c9ae2b278decd6038901b28a2a; path=/;
expires=Thu, 1-Jan-70 00:20:00 GMT;\n\r
Location: /\n\r

And the browser gets the cookie, but it does not redirect...
It displayes the Locaiton as the document content

  o _
 /|/ |   Jerrad Pierce \ | __|_ _|
 /||/   http://pthbb.org  .  | _|   |
 \||  _.-~-._.-~-._.-~-._@"  _|\_|___|___|



RE: Wierd problem with redirect

2000-05-30 Thread Wim Kerkhoff


On 30-May-2000 Jerrad Pierce wrote:
 I'm running into an odd redirect ptoblem myself, I'm issuing:
 
 HTTP/1.1 302 Moved Temporarily\n\r
 Date: Tue 30 May 2000 18:18:07 GMT\n\r
 Server: Apache/1.311\n\r
 Set-Cookie: SESSION_ID=4177a0c9ae2b278decd6038901b28a2a; path=/;
 expires=Thu, 1-Jan-70 00:20:00 GMT;\n\r
 Location: /\n\r
 
 And the browser gets the cookie, but it does not redirect...
 It displayes the Locaiton as the document content

Why are you tacking the \r onto each line? You don't need to do that, AFAIK.

After the last line in the header, you always need to put a double newline, ie,
change your last line to:

Location: /\n\n

Regards,

Wim Kerkhoff, Software Engineer
NetMaster Networking Solutions
[EMAIL PROTECTED]



Re: Wierd problem with redirect

2000-05-30 Thread ___cliff rayman___

actually \n\r\ is really how it is supposed to be.
i am sure you will find it in the RFC's.
most browsers seem to be okay with \n's only.

--
___cliff [EMAIL PROTECTED]

Wim Kerkhoff wrote:

 On 30-May-2000 Jerrad Pierce wrote:
  I'm running into an odd redirect ptoblem myself, I'm issuing:
 
  HTTP/1.1 302 Moved Temporarily\n\r
  Date: Tue 30 May 2000 18:18:07 GMT\n\r
  Server: Apache/1.311\n\r
  Set-Cookie: SESSION_ID=4177a0c9ae2b278decd6038901b28a2a; path=/;
  expires=Thu, 1-Jan-70 00:20:00 GMT;\n\r
  Location: /\n\r
 
  And the browser gets the cookie, but it does not redirect...
  It displayes the Locaiton as the document content

 Why are you tacking the \r onto each line? You don't need to do that, AFAIK.

 After the last line in the header, you always need to put a double newline, ie,
 change your last line to:

 Location: /\n\n

 Regards,

 Wim Kerkhoff, Software Engineer
 NetMaster Networking Solutions
 [EMAIL PROTECTED]







RE: Wierd problem with redirect

2000-05-30 Thread Jerrad Pierce

Yeah, and I got it towork, turns out I needed an absolute path too.
I saw that answer but since the reasn that was given is because it's in
Apache,
it didn't seem to apply. I guess the real reason is brower's are just too
brain
dead to handle it...

  o _
 /|/ |   Jerrad Pierce \ | __|_ _|
 /||/   http://pthbb.org  .  | _|   |
 \||  _.-~-._.-~-._.-~-._@"  _|\_|___|___|


 -Original Message-
 From: ___cliff rayman___ [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, May 30, 2000 17:31
 To: Wim Kerkhoff; [EMAIL PROTECTED]
 Subject: Re: Wierd problem with redirect
 
 
 actually \n\r\ is really how it is supposed to be.
 i am sure you will find it in the RFC's.
 most browsers seem to be okay with \n's only.
 
 --
 ___cliff [EMAIL PROTECTED]
 
 Wim Kerkhoff wrote:
 
  On 30-May-2000 Jerrad Pierce wrote:
   I'm running into an odd redirect ptoblem myself, I'm issuing:
  
   HTTP/1.1 302 Moved Temporarily\n\r
   Date: Tue 30 May 2000 18:18:07 GMT\n\r
   Server: Apache/1.311\n\r
   Set-Cookie: SESSION_ID=4177a0c9ae2b278decd6038901b28a2a; path=/;
   expires=Thu, 1-Jan-70 00:20:00 GMT;\n\r
   Location: /\n\r
  
   And the browser gets the cookie, but it does not redirect...
   It displayes the Locaiton as the document content
 
  Why are you tacking the \r onto each line? You don't need 
 to do that, AFAIK.
 
  After the last line in the header, you always need to put a 
 double newline, ie,
  change your last line to:
 
  Location: /\n\n
 
  Regards,
 
  Wim Kerkhoff, Software Engineer
  NetMaster Networking Solutions
  [EMAIL PROTECTED]
 
 
 
 



Re: Wierd problem with redirect

2000-05-30 Thread Eric Cholet

On Tue, May 30, 2000 at 02:30:36PM -0700, ___cliff rayman___ wrote:
 actually \n\r\ is really how it is supposed to be.
 i am sure you will find it in the RFC's.
 most browsers seem to be okay with \n's only.

Actually it's \r\n, unless you're on a Mac :-)

-- 
Eric Cholet



RE: Wierd problem with redirect

2000-05-30 Thread Robin Berjon

At 17:31 30/05/2000 -0400, Jerrad Pierce wrote:
Yeah, and I got it towork, turns out I needed an absolute path too.
I saw that answer but since the reasn that was given is because it's in
Apache,
it didn't seem to apply. I guess the real reason is brower's are just too
brain
dead to handle it...

I'm not 100% sure but iirc according to the HTTP spec Location should be
absolute. I remember having trouble once while doing contracting work for a
company that used Netscape servers, they just threw 500s when they saw a
relative redirect.


 From: ___cliff rayman___ [mailto:[EMAIL PROTECTED]]
 
 actually \n\r\ is really how it is supposed to be.
 i am sure you will find it in the RFC's.
 most browsers seem to be okay with \n's only.

Again I'm not sure but I think Apache does the conversion for you.



.Robin
Brain damage is all in your head.




RE: Wierd problem with redirect

2000-05-26 Thread Gerald Richter

Hello,

print "Content-type: text/html\n\n";
   print "HTMLHEAD";
print "META HTTP-EQUIV=\"Set-Cookie\" CONTENT=\"visirotid=$visitorid;
 path=/
 ; domain=www.trichurgateway.com;\"";
  print "/HEADBODY/BODY/HTML\n";

 Immediately after this, Iam trying the recirect.

 print "Content-type: text/html "."\n\n";
 print "Location:
 /scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n\n";
 exit 0;


You cannot send a second http header.

Do a

 print "Content-type: text/html\n";
print "Set-Cookie: visirotid=$visitorid;...  \n" ;
 print "Location:
/scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n\n";

Gerald


-
Gerald Richterecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-





Re: Wierd problem with redirect

2000-05-26 Thread Vijay

Hello,

Thanks for the suggestion. However, I have a problem still left out.

The redirection is loading the redirected page properly. But, it still shows
the URL as the same from where it is redirected.

As below:

My form calls the script
"/scripts/visitorinfo.cgi?pageid=delmaillang=ENadno=1".

In visitorinfo,.cgi, I have following steps

   print "Content-type: text/html\n";
print "$mycookie\n";
print "Location:
/scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n\n";
exit 0;

It really goes to the page mailhdr with appropriate details. But the address
in the browser is still
"/scripts/visitorinfo.cgi?pageid=delmaillang=ENadno=1".

This gives a problem. If the user reloads the page, it will again try to do
what I am doing in this, which I don't want to happen.

How do I make the address (URL) to change according to the page it is
showing.

Thanks for the helps

Vijay Nair
- Original Message -
From: "Gerald Richter" [EMAIL PROTECTED]
To: "Vijay" [EMAIL PROTECTED]; "Modperl Mailing List" [EMAIL PROTECTED]
Sent: Friday, May 26, 2000 3:05 AM
Subject: RE: Wierd problem with redirect


 Hello,
 
 print "Content-type: text/html\n\n";
print "HTMLHEAD";
 print "META HTTP-EQUIV=\"Set-Cookie\"
CONTENT=\"visirotid=$visitorid;
  path=/
  ; domain=www.trichurgateway.com;\"";
   print "/HEADBODY/BODY/HTML\n";
 
  Immediately after this, Iam trying the recirect.
 
  print "Content-type: text/html "."\n\n";
  print "Location:
  /scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n\n";
  exit 0;
 

 You cannot send a second http header.

 Do a

  print "Content-type: text/html\n";
 print "Set-Cookie: visirotid=$visitorid;...  \n" ;
  print "Location:
 /scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n\n";

 Gerald


 -
 Gerald Richterecos electronic communication services gmbh
 Internetconnect * Webserver/-design/-datenbanken * Consulting

 Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
 E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
 WWW:http://www.ecos.de  Fax:  +49 6133 925152
 -






Re: Wierd problem with redirect

2000-05-26 Thread Vijay

Repost of my earlier message. Sorry for the inconvenience. As this is very
irksome, I am really sorry for any troubles.

Vijay
- Original Message -
From: "Vijay" [EMAIL PROTECTED]
To: "Gerald Richter" [EMAIL PROTECTED]; "Modperl Mailing List"
[EMAIL PROTECTED]
Sent: Friday, May 26, 2000 10:58 AM
Subject: Re: Wierd problem with redirect


Hello,

Thanks for the suggestion. However, I have a problem still left out.

 The redirection is loading the redirected page properly. But, it still
shows
 the URL as the same from where it is redirected.

 As below:

 My form calls the script
 "/scripts/visitorinfo.cgi?pageid=delmaillang=ENadno=1".

 In visitorinfo,.cgi, I have following steps

print "Content-type: text/html\n";
 print "$mycookie\n";
 print "Location:
 /scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n\n";
 exit;

 It really goes to the page mailhdr with appropriate details. But the
address
in the browser is still
 "/scripts/visitorinfo.cgi?pageid=delmaillang=ENadno=1".

 This gives a problem. If the user reloads the page, it will again try to do
 what I am doing in this, which I don't want to happen.

 How do I make the address (URL) to change according to the page it is
 showing.

Thanks for the help

Vijay Nair
 - Original Message -
 From: "Gerald Richter" [EMAIL PROTECTED]
 To: "Vijay" [EMAIL PROTECTED]; "Modperl Mailing List" [EMAIL PROTECTED]
 Sent: Friday, May 26, 2000 3:05 AM
 Subject: RE: Wierd problem with redirect


  Hello,
  
  print "Content-type: text/html\n\n";
 print "HTMLHEAD";
  print "META HTTP-EQUIV=\"Set-Cookie\"
 CONTENT=\"visirotid=$visitorid;
   path=/
   ; domain=www.trichurgateway.com;\"";
print "/HEADBODY/BODY/HTML\n";
  
   Immediately after this, Iam trying the recirect.
  
   print "Content-type: text/html "."\n\n";
   print "Location:
   /scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n\n";
   exit 0;
  
 
  You cannot send a second http header.
 
  Do a
 
   print "Content-type: text/html\n";
  print "Set-Cookie: visirotid=$visitorid;...  \n" ;
   print "Location:
  /scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n\n";
 
  Gerald
 
 
  -
  Gerald Richterecos electronic communication services gmbh
  Internetconnect * Webserver/-design/-datenbanken * Consulting
 
  Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
  E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
  WWW:http://www.ecos.de  Fax:  +49 6133 925152
  -
 
 





Re: Wierd problem with redirect

2000-05-26 Thread Drew Taylor

Vijay wrote:
 
 Repost of my earlier message. Sorry for the inconvenience. As this is very
 irksome, I am really sorry for any troubles.
 
 Vijay
 - Original Message -
 From: "Vijay" [EMAIL PROTECTED]
 To: "Gerald Richter" [EMAIL PROTECTED]; "Modperl Mailing List"
 [EMAIL PROTECTED]
 Sent: Friday, May 26, 2000 10:58 AM
 Subject: Re: Wierd problem with redirect
 
 Hello,
 
 Thanks for the suggestion. However, I have a problem still left out.
 
  The redirection is loading the redirected page properly. But, it still
 shows
  the URL as the same from where it is redirected.
 
  As below:
 
  My form calls the script
  "/scripts/visitorinfo.cgi?pageid=delmaillang=ENadno=1".
 
  In visitorinfo,.cgi, I have following steps
 
 print "Content-type: text/html\n";
  print "$mycookie\n";
  print "Location:
  /scripts/visitorinfo.cgi?pageid=mailhdramp;lang=EN\n\n";
  exit;
 
  It really goes to the page mailhdr with appropriate details. But the
 address
 in the browser is still
  "/scripts/visitorinfo.cgi?pageid=delmaillang=ENadno=1".
 
  This gives a problem. If the user reloads the page, it will again try to do
  what I am doing in this, which I don't want to happen.
 
  How do I make the address (URL) to change according to the page it is
  showing.
You might want to try adding a Status 302  (moved temporarily) header. I
don't know if it would solve your problem, but it shouldn't hurt since
it's already "broken" in your eyes. :-)

-- 
Drew Taylor
Vialogix Communications, Inc.
501 N. College Street
Charlotte, NC 28202
704 370 0550
http://www.vialogix.com/