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.

Server wide custom 404 pages. Possible?

Discussion in 'General Discussion' started by astounding, Sep 10, 2006.

  1. astounding

    astounding Member

    Joined:
    Aug 11, 2006
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Hey,

    I intend to use cpanel for free hosting. Hence being able to customize and put ads
    on a 404 page is important. (That's one way how free webhosts profit).

    Is this possible with cPanel to make the 404 page the same server wide, unless
    the member changes it via .htaccess ofcourse ?

    Thank you!
    Andre
     
  2. sonicdriven

    sonicdriven Registered

    Joined:
    Mar 18, 2005
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    You should be able to put your .htaccess and custom error page in the Cpanel Skeleton folder. I Havent tried it but I dont see why it wouldnt work.
     
  3. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    Another option, although one I've not tried, is to put the relevant ErrorDocument handlers in the main Apache config, within each domain's VirtualHost container.

    My reasoning is that if such things work from .htaccess files, surely they should work from the main Apache config since .htaccess files are, to an extent, merely extensions to the main config. I suppose the ErrorDocument handlers would have to go, for each VirtualHost, after the DocumentRoot is specified otherwise things might get confusing.

    Leaving things at that, you'd still have the issue whereby users could override these settings in their .htaccess files. However, it's possible to specify, within the main Apache config, what users can/can't do in .htaccess files. I don't recall how nor do I recall to what extent you can control what users can/can't do in .htaccess files, but the potential is there.

    If this does actually work it will then have the benefit of preventing users from specifying their own error pages. But, as I said, I haven't tried this at all and it's just a passing thought.
     
  4. respect

    respect Member

    Joined:
    Nov 23, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Hello, Does anyone have any solution can answer this feature??
     
  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
    put a .htaccess file, which loads the relevant 404 & other error documents, in each user's public_html folder. For new users, copy the files to /root/cpanel3-skel/public_html - this way it will be copied to all new user's home dirs. Most users don't even know about these pages, or how to edit .htaccess files. The only problem you have with .htaccess, is if a user installs Joomla, or some of the other scripts in Fantastico, Fantastico reports the existance of a .htaccess file, and won't continue untill it's removed.
     
Loading...

Share This Page