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.

Creating Custom Error Pages For Server

Discussion in 'General Discussion' started by synitex, Jan 11, 2006.

  1. synitex

    synitex Member

    Joined:
    Jan 10, 2006
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Suprisingly, i did not find the solution when using the search tool.

    I have a variety of .shtml pages for the 401-500 error pages, and also the skeleton directory and suspended page.

    I wanted these to be universally added to my server so it is default on ever clients account (although they can edit through there ftp).

    So i uploaded the files to /root/cpanel3-skel/public_html/ (well only the error files here),
    but no joy.

    Apparently i need to do something with htaccess so wondered if you could explain to me what and how?
     
  2. NT

    NT Well-Known Member

    Joined:
    May 4, 2004
    Messages:
    137
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    England, UK
    Hi,

    I use the following in .htaccess:

    ErrorDocument 404 /location/to/error/file.ext

    I'm sure this allows other errors such as 500 etc, but I'm not so sure how the location part works; i.e. whether it allows URLs or just local files.

    Hope that helps :)
     
  3. Izzee

    Izzee Well-Known Member

    Joined:
    Feb 6, 2004
    Messages:
    469
    Likes Received:
    0
    Trophy Points:
    16
    Put any file you want to be loaded into the public_html directory of new accounts on creationion in here:
    /root/cpanel3-skel/public_html

    The files can include:
    your custom error pages in the format errorfilenumber.shtml

    robots.txt, favicon.ico (both these files are useful for eliminating stacks of errors in your log files)

    the custom index.html and associated image and css files for your welcome page to show their account is now live.

    Another file you think suitable for inclusion.

    When the account is created these files will be copied to the accounts public_html directory.

    If an error occurs then the errorfile.shtml will be called from this directory by default.

    If you change the location or the name of the error file like oops.shtml and have it in /public_html/error404/ directory then you must tell the system by way of a .htaccess file where to look.
    ErrorDocument 404 /error404/oops.html
    Otherwise there is no need for a .htaccess file for error messages.
    HTH

    :)
     
  4. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    /root/cpanel3-skel/public_html/ will work if root is creating the accounts, but if you're using a reseller account, you need to put the files in /home/reseller/cpanel3-skel/public_html/.
     
  5. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    How would I, as root, be able to include what's in /root/cpanel-3/skel automatically into all new reseller's accounts?
     
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,450
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Create the reseller while logged in as ROOT? Or do you mean put these default files into the resellers skel on creation?
     
Loading...

Share This Page