About Redirecting

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
gabridotns
-


Joined: 15 Apr 2009
Posts: 6

PostPosted: Tue Sep 28, 2010 1:51 pm    Post subject: About Redirecting Reply with quote

it's look like AbyssWS use internal redirecting a lot
i found a problem because of it long time ago
when i still using AbyssWS with PHP via ISAPI
i try to redirect a script to the same file with different GET value

and guess what?
PHP get error and say:
i try to define a function name that already exist
it won't be a case if the script were re executed from scratch
at that time, i was thought that it because of the PHP ISAPI module
since i already found a lot other problem because of this module

but now, i found the same problem with ddifferent cause
since i am using PHP via FastCGI now
before, it was PHP that giving error while AbyssWS give 200 OK Status
but now, it is AbyssWS giving 500 Internal Server Error Status
FastCGI log does not give some thing
access log doesn't give usefull information

what i'm asking is, is there a way to force AbyssWS to do the redirection externally?
since that thing will solve the problem (i think :D )
thanks before...
Back to top View user's profile Send private message Yahoo Messenger
admin
Site Admin


Joined: 03 Mar 2002
Posts: 1295

PostPosted: Tue Sep 28, 2010 6:28 pm    Post subject: Re: About Redirecting Reply with quote

Hello,

Can you please give us a sample PHP script which exhibits such a behavior? How are you performing redirection or what makes you think it is being a problem related to internal redirection?
_________________
Follow @abyssws on Twitter
Subscribe to our newsletter
_________________
Forum Administrator
Aprelium - https://aprelium.com
Back to top View user's profile Send private message
gabridotns
-


Joined: 15 Apr 2009
Posts: 6

PostPosted: Tue Sep 28, 2010 7:01 pm    Post subject: Reply with quote

first reason is the exhibit of this problem after my previous problem
second reason, a little bit long, when i try to redirect to another file, it just fine
but in the browser, the url in address bar is still the same
the problem is, take this scenario

a login.php file, handling all login or logout process
when someone login, the action of the form would be login.php
after successfull login, login.php redirect to index.php
then thus someone logout, without closing the window or tab
other someone, can press back until page with address login.php where it should be index.php because of the internal redirect
because this page was internally redirected, browser think its content was based on previously submited data
so when thus other someone refresh the page, browser will try to resubmit login data and, voila, thus other someone can login as the previous someone

the simple script to reproduce the behaviour is
Code:
<?php
if (empty($_GET)) die(header("Location: /phpinfo.php?mode=test"));
phpinfo();
?>


by the way, some thing poped up in fastcgi.log
hope its mean something for you, since i didn't understand about fastcgi :D
Quote:
29/Sep/2010:00:44:51 +0700 SUID: 13 PUID: 13 RUID: 0 URI: Reading 24 bytes failed = The process cannot access the file because it is being used by another process.
29/Sep/2010:00:44:51 +0700 SUID: 13 PUID: 13 RUID: 0 URI: timeout-header2!
Back to top View user's profile Send private message Yahoo Messenger
admin
Site Admin


Joined: 03 Mar 2002
Posts: 1295

PostPosted: Wed Sep 29, 2010 12:30 pm    Post subject: Reply with quote

gabridotns,

Internal redirections are activated by default when you use 'Location' with a relative URL. They are meant to reduce browser<->server roundtrips which can be a waste of bandwidth and reduce apparent speed for visitors.

To force a redirection with a change of the URL in the address bar we suggest that you use this sequence of header() calls:

header("Status: 302 Redirection");
header("Location: .....");

Note also that if you redirect to a full URL (with http://), no internal redirection takes place.
_________________
Follow @abyssws on Twitter
Subscribe to our newsletter
_________________
Forum Administrator
Aprelium - https://aprelium.com
Back to top View user's profile Send private message
gabridotns
-


Joined: 15 Apr 2009
Posts: 6

PostPosted: Wed Sep 29, 2010 3:22 pm    Post subject: Reply with quote

i change it to:
Code:
<?php
if (empty($_GET))
{
   header("Status: 302 Found");
   header("Location: /phpinfo.php?mode=test");
   die;
}
phpinfo();
?>

and still get 500 Internal Server Error status
isn't 302 is the same status PHP generate when we use location header?
i try the other status and i think 303 See Other is the right one
Code:
<?php
if (empty($_GET))
{
   header("Status: 303 See Other");
   header("Location: /phpinfo.php?mode=test");
   die;
}
phpinfo();
?>

now, it'll do the trick... yay
thanks admin, never thought about this way before :D

btw, did the script before give the same behaviour to you?
i mean, did you get the same 500 Internal Server Error status when running the script?
some times, other script using the same mekanism work fine
but at the other time, thus status appear again
so, i still unsure what the cause of it...
Back to top View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group