404 custom error page doesn't work!

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
Guidance
-


Joined: 04 May 2004
Posts: 7

PostPosted: Wed May 05, 2004 3:40 pm    Post subject: 404 custom error page doesn't work! Reply with quote

What my 404 custom error handler page does is redirecting to an alternative page respectively. It works under apache and nanoweb server, but doesn't in Abyss.

I set:
404 /_scripts/404.php
in config and the key code in 404.php is:

ob_start();
session_start();
.....
ob_clean();
header('Location:' . $url);
ob_end_flush();
exit;

The $url is the target alternative page. No matter relative or absolute url it is, the final result is the browser still shows "Error 404" default Abyss error page!
I try to add "echo $url" before header() to debug, the url displayed correctly. Seems just the header() doesn't work. How can I do then?
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Wed May 05, 2004 4:39 pm    Post subject: Reply with quote

Maybe you can try this instead , I don't
know too much about those objects but
maybe this will work instead !

Code:

<?php
$url = "/other.html";
header ("Location: $url");
?>
Back to top View user's profile Send private message Visit poster's website
Moxxnixx
-


Joined: 21 Jun 2003
Posts: 1226
Location: Florida

PostPosted: Wed May 05, 2004 4:45 pm    Post subject: Reply with quote

Looks like you put your quotes in the wrong place:
Instead of
Code:
header('Location:' .$url);

it should be
Code:
header('Location: ".$url"');


Give that a try.
Back to top View user's profile Send private message Visit poster's website
Guidance
-


Joined: 04 May 2004
Posts: 7

PostPosted: Wed May 05, 2004 4:59 pm    Post subject: not work :( Reply with quote

No matter:

header('Location: "' . $url.'"');

or

header('Location:"' . $url.'"');

or

header('Location: ' . $url);

or

header('Location:' . $url);

all same problem :(
Back to top View user's profile Send private message
Moxxnixx
-


Joined: 21 Jun 2003
Posts: 1226
Location: Florida

PostPosted: Wed May 05, 2004 5:09 pm    Post subject: Reply with quote

Could you show the full source-code?
How do you have $url setup?
Back to top View user's profile Send private message Visit poster's website
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Wed May 05, 2004 5:19 pm    Post subject: Reply with quote

In Internet Explorer , the browser has a way
of showing its own 404 Error page and that
does suck because I wish Microsoft would
take it off because its very annoying!

You will need to disbale this
in order for this to work !
Back to top View user's profile Send private message Visit poster's website
Guidance
-


Joined: 04 May 2004
Posts: 7

PostPosted: Wed May 05, 2004 5:24 pm    Post subject: Reply with quote

$url will be 'http://g.yi.org/f.php?f=13955' or relative one: '/f.php?f=13955' , both not work.

I mean, I saw the default 404 error page by Abyss, not the IE one:

<HTML><HEAD><TITLE>Error 404</TITLE></HEAD><BODY><H1>Error 404</H1><P>Not Found</P><p><HR><b><i>Abyss Web Server</i></b> X1<br>&copy; <a href="http://www.aprelium.com">Aprelium Technologies</a> - 2001-2004</p></BODY></HTML>
Back to top View user's profile Send private message
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Thu May 06, 2004 2:16 am    Post subject: Reply with quote

How about the full source code of the page?
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Guidance
-


Joined: 04 May 2004
Posts: 7

PostPosted: Thu May 06, 2004 4:29 pm    Post subject: Reply with quote

[Huge message (~47KB) removed by Aprelium]
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri May 07, 2004 2:38 pm    Post subject: Reply with quote

Guidance wrote:
[Huge message (~47KB) removed by Aprelium]

The message was too big so we deleted it. Please post URLs of these files instead.
If you can't solve this problem, please send us the PHP files and your abyss.conf file to support@aprelium.com .
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Guidance
-


Joined: 04 May 2004
Posts: 7

PostPosted: Fri May 07, 2004 4:35 pm    Post subject: Reply with quote

Email sent. Thanks in advance!
Back to top View user's profile Send private message
Guidance
-


Joined: 04 May 2004
Posts: 7

PostPosted: Sat May 08, 2004 1:58 pm    Post subject: Reply with quote

I compared with nanoweb, seems it's different $_SERVER that 'REDIRECT_STATUS=404' in nanoweb and 'REDIRECT_STATUS=200' in abyss. 200 is a fixed value in abyss config.
Back to top View user's profile Send private message
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Sat May 08, 2004 6:47 pm    Post subject: Reply with quote

You can change or delete the REDIRECT_STATUS=200 in Abyss if you want. It is there to resolve problems with some scripts.
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sun May 09, 2004 1:27 pm    Post subject: Reply with quote

Guidance,

If you remove REDIRECT_STATUS from the CGI Parameter in Abyss, you must add
Code:
cgi.force_redirect = 1

to your php.ini file to have PHP files run without a security alert.
Removing REDIRECT_STATUS from the CGI Parameter will force it to have the right value (404 if an error occurs for example.)
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP 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