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.

System Wide Custom Error Pages - 404

Discussion in 'General Discussion' started by HostRod, Aug 18, 2004.

  1. HostRod

    HostRod Member

    Joined:
    Apr 13, 2003
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Hello Everyone, just wondering if there is a way to make my own custom error pages for the entire server? Meaning, if a user account has not setup thier own custom error pages, instead of it defaulting to the bland text error page, I am wondering if there is a way to update or change the default ones so all accounts that have not created customs ones will see my custom ones instead.

    ( Holy run on sentence - lol )

    If you get what I mean, let me know.

    Thanks.

    Chris

    I am on, cPanel - WHM - Linux
     
  2. HostRod

    HostRod Member

    Joined:
    Apr 13, 2003
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    The best way to describe it, I want one page for each error code similar to the suspend or new account page that you can make as a default for server wide.

    Let me know!

    Thanks, Chris
     
  3. HostRod

    HostRod Member

    Joined:
    Apr 13, 2003
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Any Ideas or suggesstions anyone?

    Chris
     
  4. picoyak

    picoyak Well-Known Member

    Joined:
    Jun 10, 2004
    Messages:
    72
    Likes Received:
    0
    Trophy Points:
    6
    I think, along with index.html in the skeleton directory, you can simply put...

    404.shtml
    403.shtml
    etc

    in there also. That way they would be there when a new account is created. Now this wouldn't stop the user for each account from removing/changing it, but at least it would be there initially.

    That's my only idea :p
     
  5. Marty

    Marty Well-Known Member

    Joined:
    Oct 10, 2001
    Messages:
    630
    Likes Received:
    1
    Trophy Points:
    18
    Create the error pages and place them somewhere on the server. Then create an .htaccess file with the code to specify the error pages and place that .htaccess file in /home.
     
  6. HostRod

    HostRod Member

    Joined:
    Apr 13, 2003
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Hi marty thank you. Any suggestion on what I should make the .htaccess file code? No idea how to do that, and would I place a copy into every clients /home/ directory?

    Thanks!

    Chris
     
  7. nickn

    nickn Well-Known Member
    PartnerNOC

    Joined:
    Jun 15, 2003
    Messages:
    619
    Likes Received:
    1
    Trophy Points:
    18
    You can put a 404.html in yoru skel directory (find it through WHM, usually in /root/) then use this script the fix 404 errors script found at cplicensing.net
     
  8. richy

    richy Well-Known Member

    Joined:
    Jun 30, 2003
    Messages:
    276
    Likes Received:
    1
    Trophy Points:
    16
  9. nickn

    nickn Well-Known Member
    PartnerNOC

    Joined:
    Jun 15, 2003
    Messages:
    619
    Likes Received:
    1
    Trophy Points:
    18
  10. richy

    richy Well-Known Member

    Joined:
    Jun 30, 2003
    Messages:
    276
    Likes Received:
    1
    Trophy Points:
    16
    Doh! Serves me right for just "skimming" :)
     
  11. poppyq

    poppyq Well-Known Member

    Joined:
    Jul 15, 2003
    Messages:
    54
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Austin, TX
    Is there a way to make it so it uses php files instead of shtml? I used to have a php file that included html headers for my 404 pages (on ensim) but after moving to cpanel I lost that feature. Unless you can include html files as header/footer with shtml and I just don't know how to do that.
     
  12. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    That's why .shtml is used, to allow inclusion of files. Here's an example:

    Code:
    <!--#include virtual="/footer.txt" -->
    

    If you want to use php instead, just add this:

    Code:
    ErrorDocument 404 /404.pws
    
    to either the virtualhost entry in the httpd.conf file, or the .htaccess file for the domain.
     
  13. sayouly

    sayouly Member

    Joined:
    Oct 15, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Need help with the fix404errors

    I would like to create system wide error pages and have read all the posts but am still confused.

    1. what extension do use when I save the fix404errors .cgi, .pl ????
    2. Where on my server do I put the fix404errors script
    3. Does it need chmod?
    4. Once installed, will this create system erorpages for existing users as well as any new users, or only for accounts created after the scripts are installed?

    Hope someone out there can help me. Thanks in advance.

    John
     
Loading...

Share This Page