The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Using php in custom error pages

Discussion in 'General Discussion' started by kgx, Aug 23, 2005.

  1. kgx

    kgx Registered

    Joined:
    Aug 23, 2005
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi. Hope this is the right place to post. I'm hosted on a remote server (thus not in control of cpanel's installation) and I needed to use php in custom error pages. However it doesn't seem to work. I tried adding the mime types (for shtml) and even tried saving the file as php, but no luck :( It has cpanel version 10.2.0-RELEASE 82 on Apache 1.3.

    Thanks heaps for your help :)
     
  2. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    The easiest way would be to pop a .htaccess file in your public_html directory.

    Here's what I have in mine to get a php-based 404 page:

    Code:
    ErrorDocument 404 /~username/404.php
    Repeat the same for all the errors you want to catch.
     
  3. kgx

    kgx Registered

    Joined:
    Aug 23, 2005
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Thanks :)

    PS: Maybe one of the developers could add this in as a feature in cpanel :)
     
Loading...

Share This Page