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.

File does not exist: 404.shtml - How to make it for all accounts?

Discussion in 'General Discussion' started by postcd, May 8, 2014.

  1. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    619
    Likes Received:
    6
    Trophy Points:
    18
    Hello, is there any good way on how to create an 404.shtml file for all newly created cpanela ccounts automatically?

    I mean one way is to have it added to each account www folder,
    then modifying httpd.conf and setting some kind of redirect?

    But i need cpanel users to be able to override this redirect..

    what is the clever way to solve this? or i should let the errors come in my server httpd error_log file?
     
  2. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    619
    Likes Received:
    6
    Trophy Points:
    18
    Will the mentioned tutorial fix the reported 404 errors while the 404 document is just included instead being physically located in users www folder?
    How can user override these 404 by his own?
     
  3. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,446
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Add default files you want all accounts to start out with, to the root/cpanel3-skel/ and/or for reseller, username/cpanel3-skel/ directories to prevent error log cruft.
    Skeleton Directory - cPanel Documentation

    I like to add a plain txt file as well, explaining what the default files are and how to modify them for the new user. For example:

    defaultfiles.png
     
  4. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    619
    Likes Received:
    6
    Trophy Points:
    18
    yes, this i dont want to do. i dont want to add any files to the user accounts if possible. Would be more wise and better to set any global 404.shtml which anyone can override in htaccess or by creating another 404 file?
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,664
    Likes Received:
    646
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Please ensure you read the full thread that I referenced. Both questions are answered in that thread.

    Thanks.
     
  6. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    619
    Likes Received:
    6
    Trophy Points:
    18
    That topic is quite large. if you know the answer, please post it.
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,664
    Likes Received:
    646
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    The first post itself explains that a 404 page is not required in every account. It's only required in a single directory:

    http://forums.cpanel.net/f5/cpanel-whm-custom-403-page-all-accounts-208702.html#post856912

    This next post answers a question that another user had regarding the ability for a user to override these settings. It's at the end of the post:

    http://forums.cpanel.net/f5/cpanel-whm-custom-403-page-all-accounts-208702.html#post856951

    Please note that reading an entire thread might seem like a tedious task, but it's really the best way to learn new information.

    Thank you.
     
  8. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    619
    Likes Received:
    6
    Trophy Points:
    18
    Thanks, so i did it as you described in your post http://forums.cpanel.net/f5/cpanel-whm-custom-403-page-all-accounts-208702.html#post856912

    Added this to Pre VirtualHost Include All versions:

    i saved & restarted apache

    cat /usr/local/apache/customerror/404.shtml
    -rw-r--r-- 1 root root 15 Sep 10 18:21 404.shtml

    But in user account which is without .htaccess and without php.ini i type to browser: thataccountdomain.com/nonexistingphrasse and it returns:

    So please can You tell why
    is not shown?

    When i add into virt. host include following code it starts to show:
    but mentioned code with alias dont work

    Thank you
     
    #9 postcd, Sep 28, 2014
    Last edited: Sep 28, 2014
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,664
    Likes Received:
    646
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Feel free to open a support ticket using the link in my signature so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
  10. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    619
    Likes Received:
    6
    Trophy Points:
    18
    Also i found this works:

    OPTION A)
    OPTION B)
     
Loading...

Share This Page