Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Jun 2009
    Posts
    13

    Default Custom 404 pages per site

    Using Cpanel I have one main account and a bunch of add on domains under that account. What I want to do is be able to provide custom 404 pages per site. Some sites I want it to actually redirect them to the home page of that site, for others I would like to display a custom 404 page. How would I go about doing that?

    So one site if they go to www.site1.com/somepage.html and somepage.html is not there I want it to redirect to www.site1.com

  2. #2
    Member
    Join Date
    Apr 2011
    Location
    Chicago, IL
    Posts
    123
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Custom 404 pages per site

    Sounds like your mixing 301 redirects and 404 error pages. Cpanel however does have a section on the user end that allows the creation of the error pages for you.

  3. #3
    Member
    Join Date
    Jun 2009
    Posts
    13

    Default Re: Custom 404 pages per site

    Quote Originally Posted by tank View Post
    Sounds like your mixing 301 redirects and 404 error pages. Cpanel however does have a section on the user end that allows the creation of the error pages for you.
    No dont want a 301 redirect. I want a 404 error to redirect back to the home page of the site. I can do that via htaccess but some sites I want just regular 404 pages and some sites I want it to redirect back to the home page of the site if a 404 error happens.

  4. #4
    Member
    Join Date
    Apr 2011
    Location
    Chicago, IL
    Posts
    123
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Custom 404 pages per site

    So make an html page and copy all of your code expect the content section. Put
    Code:
    <h2>404 Error page</h2>
            <p><!--#echo var="REQUEST_URI" -->  does not exist. <a href="#" class="und"><strong></strong></a>Please check that address and try again.  </p>.
    Boom you have a 404 page that looks exactly as your home page.

    I am sorry if I am not understanding what you are asking. As for the 404 page the redirects to another page, I am unsure as to how to accomplish that.

    Use caution with these error pages, because if not done properly you can get penalized by the search engine for having duplicate content.

  5. #5
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Custom 404 pages per site

    If someone reaches a non-existent page, they should know they reached the wrong page. While you could have a link back to the home page on your custom 404 page, I do not suggest simply redirecting back to the home page with it unless it is going to do so on a time delay after informing the user that the page doesn't exist.

    If you do want to follow that direction to at least inform the user, then you can use a meta refresh in HTML to do this using cPanel > Error pages > 404 (not found) and putting the following content:

    Code:
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="refresh" CONTENT="15;http://domain.com">
    </HEAD>
    <BODY>
    This page is not found. You will be redirected in 15 seconds to the main site.
    </BODY>
    </HTML>
    Upon adding that content, you will need to change domain.com to the actual domain name. This works perfectly well on my test site:

    http://tristanwallace.com/notfound

    You could also change 15 seconds to whatever interval you prefer in both the META tag and the BODY area.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

Similar Threads & Tags
Similar threads

  1. Server wide custom 404 pages. Possible?
    By astounding in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 12-22-2006, 12:22 AM
  2. Custom 404 pages not working
    By DeepXP in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 07-23-2005, 01:49 AM
  3. 404 custom pages not working
    By royli57 in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 05-07-2005, 08:26 PM
  4. System Wide Custom Error Pages - 404
    By HostRod in forum cPanel and WHM Discussions
    Replies: 12
    Last Post: 12-14-2004, 10:00 PM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube