Web Hosting Talk







View Full Version : httpd.conf error pages, problems...


deras
07-30-2004, 05:12 PM
i am trying to get error pages set up on my site/server but it does not seem to work.

so far i tried this...

<VirtualHost xx.xx.xx.xx>
ServerName x***********
DocumentRoot "/var/www/html"
AddType application/x-httpd-php .php .html
ScriptAlias /cgi-bin/ /var/www/html/cgi-bin/
ErrorDocument 403 /index.html
ErrorDocument 404 /index.html
</VirtualHost>

i also added an .htaccess file to the root web folder with

ErrorDocument 403 /index.html
ErrorDocument 404 /index.html


but the error pages are not loading

is there something else i need to change in httpd.conf to get error pages to work?

Workaholic
07-30-2004, 05:29 PM
The directives look fine. Did you restart Apache after making those changes?

Mind you, the .htaccess version should work even without restarting Apache. If I were you I would try removing the .htaccess lines (just to be sure that you are troubleshooting the httpd.conf version) and then restarting Apache if you haven't done that already.

Workaholic
07-30-2004, 05:32 PM
Oh yeah... and I gather that index.html is actually the page you want to use as the error page?

Just checking :)

deras
07-30-2004, 07:22 PM
i pressed "apply changes" in webmin which is supposed to get the changes working.

but .htaccess alone should have worked and it's not working, so i am confused.

index is the file i wanted (i just want to send people to the home page).

myidealhost
07-31-2004, 01:34 PM
Check size of your index.html
I had a problem enabling the error pages because the error files were less then XXX bytes (sorry I don't remember the exact size now, it must be something around 255 bytes).
ErrorDocument directive simply doesn't work if your error page size is less then some value.

So my advice is make sure your index.html size is at least 1k .

Workaholic
07-31-2004, 07:07 PM
Yeah! That's right... I had forgotten about that size requirement for the missing document file. I believe the problem affects only Internet Explorer and the minimum file size is 524 bytes. One option is to add some HTML comment lines to your file to get it over the 524 mark.

Cheers :)

deras
08-01-2004, 01:50 PM
it's 3kb so that's not the problem.

EzziDotNet
08-01-2004, 06:15 PM
Originally posted by myidealhost
Check size of your index.html
I had a problem enabling the error pages because the error files were less then XXX bytes (sorry I don't remember the exact size now, it must be something around 255 bytes).
ErrorDocument directive simply doesn't work if your error page size is less then some value.

So my advice is make sure your index.html size is at least 1k .

This is actually because Microsoft's "friendly errors" will ignore an errordoc of less than that size.