Web Server Configuration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsWeb DesignWeb Server Configuration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old March 18th, 2004, 07:01 AM
Spongy's Avatar
Spongy Spongy is offline
Alternately High
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Hilversum, Netherlands
Posts: 223 Spongy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 56 m 41 sec
Reputation Power: 5
Send a message via MSN to Spongy
Question Custom errorpages with .htaccess and PHP

Howdy!

I'm trying to create my own custom errorpages with .htaccess refferring to a php document. So I searched on google and now I know that I have to use the line
ErrorDocument 404 /error.php?c=404
But then I get a problem... My server is returning an error 500: internal server error...
It works fine when I point my browser directly to the error.php file...
I don't seem to find the solution... I will post my code below. Can anyone help me please?
PHP Code:
<?
include "session.php";
header("Pragma: no-cache");
$title "Spongy Kickin Yo Ass ::: Fout";

// Bad request
$errmsg['400'] = "De URL die je hebt opgevraagd heeft een \"Bad Request\" opgeleverd.<br />
                  Het probleem is waarschijnlijk opgelost terwijl je dit zit te lezen."
;
// Ongemachtigd
$errmsg['401'] = "De URL die je hebt opgevraagd, heeft een autorisatie nodig.";
// Verboden
$errmsg['403'] = "Toegang tot deze URL is verboden.";
// HTML CODE TO APPEAR WHEN A DOCUMENT NOT FOUND HAPPENS
$errmsg['404'] = "De URL is niet gevonden.<br />
                  Of je hebt het verkeerde adres ingetypt, of deze link doet het niet meer.<br />
                  Gebruik in het laatste geval de ideeënbus en geef precies aan om welke link het gaat."
;
// HTML CODE TO APPEAR WHEN AN UNKNOWN ERROR OCCURS
$errmsg['000'] = "De URL die je hebt opgevraagd heeft een onbekende fout opgeleverd.<br />
                  Het probleem is waarschijnlijk opgelost terwijl je dit zit te lezen."
;

$titel "Fout ".$_GET['c'];
$tekst $errmsg[$_GET['c']];
include 
"header.php";
print 
"<div id=\"titel\">".$titel."</div>";
print 
"<div id=\"tekst\">".$tekst."</div>";
include 
"footer.php";

?>

Cheers
__________________
Work to live, don't live to work

Reply With Quote
  #2  
Old March 18th, 2004, 07:45 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
I suspect it's the query string. Try removing ?c=404 from the end of the filename and see if that solves your problem.
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
  #3  
Old March 18th, 2004, 09:24 AM
Spongy's Avatar
Spongy Spongy is offline
Alternately High
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Hilversum, Netherlands
Posts: 223 Spongy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 56 m 41 sec
Reputation Power: 5
Send a message via MSN to Spongy
Nope, tried it but still an internal server error...
I searched in my Apache config, but I don't seem to find anything related to this specific problem.
Any ideas?
BTW, I'm using Debian Linux as my server

Last edited by Spongy : March 18th, 2004 at 09:26 AM. Reason: Forgot something :D

Reply With Quote
  #4  
Old March 18th, 2004, 10:07 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Check your AllowOverride settings in your conf. I always have to head back over to apache.org to make sure I've got my settings right.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignWeb Server Configuration > Custom errorpages with .htaccess and PHP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway