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!

SOLVED How to remove Webmaster email from pages 404

Discussion in 'General Discussion' started by Rodrigo Gomes, Jul 24, 2018.

  1. Rodrigo Gomes

    Rodrigo Gomes Well-Known Member

    Joined:
    Apr 6, 2016
    Messages:
    113
    Likes Received:
    26
    Trophy Points:
    28
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    Hello guys,

    How do I remove this email from the standard cPanel 404 error page?
    There is no option to edit this.

    This page appears when the domain does not exist on the server, but continues to point to our server.

    It is very inconvenient to receive several emails per day in relation to these sites.

    print.png
     
  2. HostingH

    HostingH Well-Known Member

    Joined:
    Jan 13, 2008
    Messages:
    125
    Likes Received:
    17
    Trophy Points:
    68
    cPanel Access Level:
    Root Administrator
    404 page is available under servers document root and file name is cp_errordocument.shtml, you can edit that page as per your need.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    2,212
    Likes Received:
    159
    Trophy Points:
    143
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    HI @Rodrigo Gomes

    The correct way to make modifications to the error pages is to make the changes according to the documentation here: Error Pages - Version 72 Documentation - cPanel Documentation

    This would require you to create your own though.

    Editing cp_errordocument.shtml can be done though we can't guarantee that it won't be overwritten. The line you'd need to modify would be the one as follows:

    Code:
                    Please forward this error screen to <!--#echo var="SERVER_NAME" -->'s <a href="mailto:<!--#echo var="SERVER_ADMIN" -->?subject=Error message [<!--#echo var="REDIRECT_STATUS" -->] <!--#echo var="title" --> for <!--#echo var="HTTP_HOST" --><!--#echo var="REQUEST_URI" --> port <!--#echo var="SERVER_PORT" --> on <!--#echo var="DATE_LOCAL"-->"> WebMaster</a>.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Rodrigo Gomes

    Rodrigo Gomes Well-Known Member

    Joined:
    Apr 6, 2016
    Messages:
    113
    Likes Received:
    26
    Trophy Points:
    28
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    I was able to change this by editing the file cp_errordocument.shtml.
    Is there a way to permanently remove this email?
    Or stop displaying error pages for sites that are not hosted on our server.
     
  5. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    2,212
    Likes Received:
    159
    Trophy Points:
    143
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @Rodrigo Gomes

    As I explained earlier the proper way to modify these is to use Error Pages - Version 72 Documentation - cPanel Documentation.

    You should be able to configure the page to whatever you would like. As far as displaying errors for sites that are not hosted on your server, as long as the domain continues to be hosted on your server this is tricky. The default page should display for these and this is customizable as well. You can modify this through WHM>>Account Functions>>Web Template Editor you can also customize the Account Move template for domains that were hosted on your server but aren't any longer though they may not have modified their DNS.

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Rodrigo Gomes

    Rodrigo Gomes Well-Known Member

    Joined:
    Apr 6, 2016
    Messages:
    113
    Likes Received:
    26
    Trophy Points:
    28
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    Hello @cPanelLauren ,

    This works only if the domain has an account in cPanel, which is not the case.

    There is no option to edit 404 pages in Web Template Editor. I did this by modifying the cp_errordocument.shtml file, but I believe it will be overwritten.

    Thank you!
     
  7. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    2,212
    Likes Received:
    159
    Trophy Points:
    143
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @Rodrigo Gomes

    If the domain isn't hosted on your server and the account is removed it shouldn't be displaying a 404 which is the point I've been trying to make.

    The point being though When a domain is not hosted on your server the default page should be displayed which is why I suggested this.

    If you're getting a 404 when attempting to view a site that is no longer hosted on your server it sounds like you may not have removed the account fully.


    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Rodrigo Gomes

    Rodrigo Gomes Well-Known Member

    Joined:
    Apr 6, 2016
    Messages:
    113
    Likes Received:
    26
    Trophy Points:
    28
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    Hello @cPanelLauren,
    I can ensure that the domain is no longer hosted on the server.

    The domain uses Cloudflare, so it keeps pointing to the IP of our server.

    If you access the URI / it displays the default page.
    If you access an any URI (example /non-existent-page/), it will display a 404 error page.

    Thanks!
     
  9. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    2,212
    Likes Received:
    159
    Trophy Points:
    143
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Rodrigo Gomes

    Rodrigo Gomes Well-Known Member

    Joined:
    Apr 6, 2016
    Messages:
    113
    Likes Received:
    26
    Trophy Points:
    28
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    Hello @cPanelLauren ,

    The domain is no longer hosted on our server, it has been completely removed. I did not understand how the domain forwarder could help me in this case.

    cPanel by default displays a 404 error page for sites that are no longer hosted on our server and this page includes the email address of our system, which is quite inconvenient. And as far as I can see, there is not an option to edit that page through WHM or permanently.

    Any domain on the internet can point to the IP of our server, this is not something we can control by WHM.
    And there is no option to not display the default cPanel page for domains that are not hosted on our system.
     
  11. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    2,212
    Likes Received:
    159
    Trophy Points:
    143
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Both of these statements are correct this is true for any hosting platform. I can point any domain to any server - now that doesn't mean my domain is going to work it just means I'll get their default page or their instructions for domains not hosted on the server. This can't be changed due to lack of control over where people point their domains.

    The domain forwarder allows you to redirect a domain that is not hosted on your server to a location you choose. I'm not sure what you're expecting to happen in this instance, a 404 for a URL that doesn't exist but is pointed at your server is expected. The default page for a domain that is not hosted on your server but pointed to your server is the expected behavior. If you want to modify this behavior you can do so by using the domain forwarder.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    rpvw likes this.
  12. Rodrigo Gomes

    Rodrigo Gomes Well-Known Member

    Joined:
    Apr 6, 2016
    Messages:
    113
    Likes Received:
    26
    Trophy Points:
    28
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    Hello @cPanelLauren ,

    I get it.
    But, what I miss is more control over that default page.
    I wish I did not display it, or be able to change it.

    Forwarding the domain is impractical, it would have to be done manually for each new domain that points to our server.
     
  13. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    2,212
    Likes Received:
    159
    Trophy Points:
    143
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @Rodrigo Gomes

    I've already shown you how to change the default page though, this is perfectly possible. The default page is modifiable by going to WHM>>Account Functions>>Web Template Editor -> Default Website Page

    Beyond that it is beyond our control to determine which domains are allowed to point their IP's to you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. Rodrigo Gomes

    Rodrigo Gomes Well-Known Member

    Joined:
    Apr 6, 2016
    Messages:
    113
    Likes Received:
    26
    Trophy Points:
    28
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    Hello @cPanelLauren ,

    This does not include the default 404 error page, which is the subject of this topic.
    Where it is necessary to change the file cp_errordocument.shtml and may be overwritten.

    I know that.
    But it is my control to choose what to show for them.
     
  15. Rodrigo Gomes

    Rodrigo Gomes Well-Known Member

    Joined:
    Apr 6, 2016
    Messages:
    113
    Likes Received:
    26
    Trophy Points:
    28
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    I think to do this, I will need to send a feature request.

    So I go ahead and I will make this request. Thank you.
     
  16. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    2,212
    Likes Received:
    159
    Trophy Points:
    143
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  17. Rodrigo Gomes

    Rodrigo Gomes Well-Known Member

    Joined:
    Apr 6, 2016
    Messages:
    113
    Likes Received:
    26
    Trophy Points:
    28
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    Hello @cPanelLauren ,

    This gave me an idea of how I can resolve this in a definitive way through VirtualHost, thank you!
     
  18. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    2,212
    Likes Received:
    159
    Trophy Points:
    143
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @Rodrigo Gomes

    I'm glad to hear that! If your idea works please let us know what you did so it may help others!

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  19. Rodrigo Gomes

    Rodrigo Gomes Well-Known Member

    Joined:
    Apr 6, 2016
    Messages:
    113
    Likes Received:
    26
    Trophy Points:
    28
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    I just added the code below into pre_virtualhost_global.conf:

    Code:
    <VirtualHost 123.456.789.10:80>
        DocumentRoot /var/www/html
        ErrorDocument 404 /index.html
    </VirtualHost>
    You change this 123.456.789.10:80 to the primary IP of your server and the port you want.
     
  20. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    2,212
    Likes Received:
    159
    Trophy Points:
    143
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @Rodrigo Gomes


    Thanks for sharing that with us. I'm glad you were able to find a solution that worked for you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Rodrigo Gomes likes this.
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