Hi all, I've got some amazing problem with my httpd.conf (Linux RHEL3 and ap ache 2.0.17) What I would be able to do is to redirect users to a special page in case th e requested page doesn't exist. In order to do this I prefer to modify httpd.conf instead of using a .htacce ss file due to its lack of performance. I've created a simple .htm page bigger than 512 Bytes. I can put it everywhe re on my disk but something always goes wrong. The bad code look like this: <Directory "/home......."> ErrorDocument 404 /noScheda.htm </Directory> I know document root, and I can access via browser to the page noScheda.htm http://....... .it/noScheda.htm works. When I close and restart Apache and make a request the browser answers 404 b ut not with my page. Why, if I use a valid URL instead, does the server answer correctly? <Directory "/home....."> ErrorDocument 404 http://www. ......... /noScheda.htm </Directory> This works. Why I've got these problems with local URI? I know I must use a path relativ e to the "browser path", in other words specify a path coming after the .it (or .com)... I'm confused. I've also tried to use alias and/or string ErrorDocument 404 "Sorry" No way. Can anyone help me? There's no include or other ErrorDocument uncommented in http.conf. Thanks Max
I can try but i prefer not using .htaccess. Httpd.conf is full of AllowOverride none. If you think this could be an usefull test I can try to make it work, but I think it will cost me quite lot of time. Why do you think putting that directive in .htaccess would lead to a different result than writing it on httpd.conf? Thank you for the quick response.
Probably too late to help mpalmier, but I had the same problem. I finally fixed it by putting the ErrorDocument declaration in the <VirtualHost *:80> section of my httpd.conf file.
Do you have any panel on your server? If yes, check its settings, as Directadmin and CPanel provide users with custom Error pages and I think it'll be much easier to use them.