Custom 404 Not Found Page

Discussion in 'Apache' started by crazyryan, May 3, 2008.

  1. #1
    Hey

    Sometimes on my website the user might come accross a 404 error.

    What I want to do is customise that page, how can I do that?

    ErrorDocument 404 /error.php

    Didn't show error.php, so I'm not sure if that's the wrong code or what.
     
    crazyryan, May 3, 2008 IP
  2. WebGeek182

    WebGeek182 Active Member

    Messages:
    510
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    95
    #2
    That's the right code...there may be something else interfering with it, or you may need to make sure that the custom page you want is uploaded in the right location. Also, just to check...You have that in the .htaccess in your website's public root?
     
    WebGeek182, May 3, 2008 IP
  3. Trusted Writer

    Trusted Writer Banned

    Messages:
    1,370
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    160
    #3
    I was told by my hosting that such problem is a weird issue with PHP 5

    The walkround to get your error pages displayed again is adding the following rule to your .htaccess file

    
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase / 
    
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
    RewriteRule ^.+.php$ /bogusfile
    
    Code (markup):
     
    Trusted Writer, May 3, 2008 IP