1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problems setting up custom 404 error page with cpanel

Discussion in 'General Discussion' started by Barnez1, May 30, 2012.

  1. Barnez1

    Barnez1 New Member

    Joined:
    May 30, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    My site is on shared hosting and I'm using the cPanel Pro 1.0 (RC1). I've recently worked through the error pages feature on the cpanel to create a basic custom 404 error page which has been uploaded to the root folder as '404.shtml'.

    The problem is that I can see the page at /http://www.englishlc.com/404.shtml however it is not being linked to when I type in an incorrect site page.
    I've tried inserting 'ErrorDocument 404 /404.shtml' into the htaccess file but that hasn't made a difference. Am I missing something simple here? Any clues would be much appreciated.

    Barnez1
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    12,118
    Likes Received:
    31
    Trophy Points:
    48
    Location:
    Pennsylvania
    Looks like you might have something going on in your .htaccess file that's catching incorrect URLs and forwarding back to homepage.
     
  3. Barnez1

    Barnez1 New Member

    Joined:
    May 30, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Many thanks for your reply. My htaccess file is as follows:

    Code:
    # Created by Redirection Module: Apache
    # Tue, 29 May 2012 08:38:40 +0000
    # Redirection 2.2.13 - [url=http://urbangiraffe.com/plugins/redirection/]Redirection – Manage 301 redirections without modifying Apache | Urban Giraffe[/url]
    
    <Files .htaccess,.svn>
    order allow,deny
    deny from all
    </Files>
    Options +FollowSymlinks
    
    <IfModule mod_rewrite.c>
    </IfModule>
    
    # End of Redirection
    # BEGIN WPSuperCache
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    #If you serve pages from behind a proxy you may want to change \'RewriteCond %{HTTPS} on\' to something more sensible
    AddDefaultCharset UTF-8
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{HTTPS} on
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html.gz -f
    RewriteRule ^(.*) "/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html.gz" [L]
    
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{HTTPS} !on
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html.gz -f
    RewriteRule ^(.*) "/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html.gz" [L]
    
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTPS} on
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html -f
    RewriteRule ^(.*) "/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html" [L]
    
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTPS} !on
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html -f
    RewriteRule ^(.*) "/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html" [L]
    </IfModule>
    
    # END WPSuperCache
    
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    ErrorDocument 404 /404.shtml
    
    
    Are you able to see a conflict there?
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    12,118
    Likes Received:
    31
    Trophy Points:
    48
    Location:
    Pennsylvania
    I can't comment on this, but, rename it to kill / disable it for a moment. See if your error pages work then.
     
  5. Barnez1

    Barnez1 New Member

    Joined:
    May 30, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I tried your suggestion. After isolating the .htaccess file by renaming it, the custom 404 page shows when I try a false site page; however it also shows when I use a true sitepage url.
     
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    12,118
    Likes Received:
    31
    Trophy Points:
    48
    Location:
    Pennsylvania
    This is something you'd want to take up on the wordpress support forums, or with that plugin author directly:
    /http://wordpress.org/tags/redirection?forum_id=10

    (Top of your code above mentions the redirection module.)

    This doesn't appear to be a cPanel issue I don't think.
     

Share This Page