View previous topic :: View next topic |
Author |
Message |
Guidance -
Joined: 04 May 2004 Posts: 7
|
Posted: Wed May 05, 2004 3:40 pm Post subject: 404 custom error page doesn't work! |
|
|
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 |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Wed May 05, 2004 4:39 pm Post subject: |
|
|
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 |
|
 |
Moxxnixx -
Joined: 21 Jun 2003 Posts: 1226 Location: Florida
|
Posted: Wed May 05, 2004 4:45 pm Post subject: |
|
|
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 |
|
 |
Guidance -
Joined: 04 May 2004 Posts: 7
|
Posted: Wed May 05, 2004 4:59 pm Post subject: not work :( |
|
|
No matter:
header('Location: "' . $url.'"');
or
header('Location:"' . $url.'"');
or
header('Location: ' . $url);
or
header('Location:' . $url);
all same problem :( |
|
Back to top |
|
 |
Moxxnixx -
Joined: 21 Jun 2003 Posts: 1226 Location: Florida
|
Posted: Wed May 05, 2004 5:09 pm Post subject: |
|
|
Could you show the full source-code?
How do you have $url setup? |
|
Back to top |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Wed May 05, 2004 5:19 pm Post subject: |
|
|
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 |
|
 |
Guidance -
Joined: 04 May 2004 Posts: 7
|
Posted: Wed May 05, 2004 5:24 pm Post subject: |
|
|
$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>© <a href="http://www.aprelium.com">Aprelium Technologies</a> - 2001-2004</p></BODY></HTML> |
|
Back to top |
|
 |
iNaNimAtE -
Joined: 05 Nov 2003 Posts: 2381 Location: Everywhere you're not.
|
Posted: Thu May 06, 2004 2:16 am Post subject: |
|
|
How about the full source code of the page? _________________ Bienvenidos! |
|
Back to top |
 |
 |
Guidance -
Joined: 04 May 2004 Posts: 7
|
Posted: Thu May 06, 2004 4:29 pm Post subject: |
|
|
[Huge message (~47KB) removed by Aprelium] |
|
Back to top |
|
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Fri May 07, 2004 2:38 pm Post subject: |
|
|
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 |
|
 |
Guidance -
Joined: 04 May 2004 Posts: 7
|
Posted: Fri May 07, 2004 4:35 pm Post subject: |
|
|
Email sent. Thanks in advance! |
|
Back to top |
|
 |
Guidance -
Joined: 04 May 2004 Posts: 7
|
Posted: Sat May 08, 2004 1:58 pm Post subject: |
|
|
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 |
|
 |
iNaNimAtE -
Joined: 05 Nov 2003 Posts: 2381 Location: Everywhere you're not.
|
Posted: Sat May 08, 2004 6:47 pm Post subject: |
|
|
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 |
 |
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Sun May 09, 2004 1:27 pm Post subject: |
|
|
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 |
|
 |
|