1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.
  2. Better Analytics for WordPress Get It Free

ErrorDocument not working in httpd.conf

Discussion in 'Apache' started by mpalmier, Feb 14, 2006.

  1. #1
    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
     
    mpalmier, Feb 14, 2006 IP
  2. bentong

    bentong Banned

    Messages:
    3,543
    Likes Received:
    257
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try adding the errordocument line on your htaccess
     
    bentong, Feb 14, 2006 IP
  3. mpalmier

    mpalmier Guest

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    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.
     
    mpalmier, Feb 14, 2006 IP
  4. mpalmier

    mpalmier Guest

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Anyone?
    Suggestions?
     
    mpalmier, Feb 15, 2006 IP
  5. ahbowers

    ahbowers Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    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.
     
    ahbowers, Oct 10, 2008 IP
  6. vovaNux

    vovaNux Peon

    Messages:
    47
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    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.
     
    vovaNux, Nov 12, 2008 IP