HomeTutorialsGet Apache Web Hosting
Pages: [1]
  Print  
Author Topic: Custom errors won't work?  (Read 168 times)
sonic
Newbie
*
Posts: 1


View Profile
« on: October 26, 2008, 05:42:16 PM »

I'm trying to get my custom error pages to work, but I'm failing miserably.

Situation:

- Ubuntu Hardy 8.04
- Apache 2
- Php 5.x
- Documentroot /var/www/...

I have multiple subdomains active on my server, where the 2 most important are the main site and my blog. Now I want to give people a nice custom 404 page (at least) to help them out while visiting my server.

I have tried allmost everything, (I prefer not to use the .htaccess manner) so I work with the ErrorDocument directive.

When I link the 404 Error to the page /var/www/error/404.php, and I try to visit a "wrong" page like hhhh I get the following error in the apache log file

[error] [client x.x.x.x] File does not exist: /var/www/blog/hhhh
[error] [client x.x.x.x] File does not exist: /var/www/blog/var

But, when I put the absolute url of my website as a value http://www.mysite.com/error/404.php, it works, but that's not how it's supposed to work.

On the webpage itself, i get the "standard" error message :

Code:
Not Found
The requested URL /hhhh was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

It seems that the "/" is not correctly read, so it wants to read the error pages from a subdirectory instead of the document root. I'm going crazy!


« Last Edit: October 26, 2008, 06:08:51 PM by sonic » Logged
Pages: [1]
  Print  
 
Jump to:  

Advertising