Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jul 2006
    Posts
    112
    Thanks
    1
    Thanked 0 Times in 0 Posts

    403 and 404 Redirection with Apache

    I am trying to redirect users that try to access either forbidden or missing files to a standard error page using Apache v1.3.35. I did some reading and found that using "ErrorDocument 404 /error.php" in httpd.conf does the trick quite nicely until I try to access something like "www.domain.com/folder_does_not_exist/".

    In that case my pages look for my CSS sheets, which are stored in /CSS/, in /folder_does_not_exist/CSS/ therefore error.php displays, but without styles.

    Same thing happens with images that are in /images/ any idea what I am doing wrong?

  • #2
    Regular Coder
    Join Date
    Jul 2006
    Posts
    112
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Answer to my question was found here:

    One trick, though, is to remember that error pages can pop up anywhere in your site heirarchy, so make sure all your graphic references, links to other areas on the site, etc, are absolute references, that they start with '/' or, in extreme cases, 'http:'.

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Followup

    Paulq,

    Thanks for the followup!
    Regards,
    Ronald.
    ronaldvanderwijden.com


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •