Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    694
    Likes Received:
    15
    Trophy Points:
    68
    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?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    694
    Likes Received:
    15
    Trophy Points:
    68
    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?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,478
    Likes Received:
    421
    Trophy Points:
    583
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    694
    Likes Received:
    15
    Trophy Points:
    68
    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?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Please ensure you read the full thread that I referenced. Both questions are answered in that thread.

    Thanks.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    694
    Likes Received:
    15
    Trophy Points:
    68
    That topic is quite large. if you know the answer, please post it.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    694
    Likes Received:
    15
    Trophy Points:
    68
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #9 postcd, Sep 28, 2014
    Last edited: Sep 28, 2014
  10. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    694
    Likes Received:
    15
    Trophy Points:
    68
    Also i found this works:

    OPTION A)
    OPTION B)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice