SOLVED How to remove Webmaster email from pages 404

Rodrigo Gomes

Well-Known Member
Apr 6, 2016
126
29
28
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
 

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
9,010
762
263
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>.
 

Rodrigo Gomes

Well-Known Member
Apr 6, 2016
126
29
28
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.
 

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
9,010
762
263
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!
 

Rodrigo Gomes

Well-Known Member
Apr 6, 2016
126
29
28
Brazil
cPanel Access Level
Root Administrator
Hello @cPanelLauren ,

As I explained earlier the proper way to modify these is to use Error Pages - Version 72 Documentation - cPanel Documentation.
This works only if the domain has an account in cPanel, which is not the case.

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.
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!
 

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
9,010
762
263
Houston
cPanel Access Level
DataCenter Provider
Hi @Rodrigo Gomes

This works only if the domain has an account in cPanel, which is not the case.
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.

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.
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!
 

Rodrigo Gomes

Well-Known Member
Apr 6, 2016
126
29
28
Brazil
cPanel Access Level
Root Administrator
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.
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!
 

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
9,010
762
263
Houston
cPanel Access Level
DataCenter Provider

Rodrigo Gomes

Well-Known Member
Apr 6, 2016
126
29
28
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.
 

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
9,010
762
263
Houston
cPanel Access Level
DataCenter Provider
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
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.
 
  • Like
Reactions: rpvw

Rodrigo Gomes

Well-Known Member
Apr 6, 2016
126
29
28
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.
 

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
9,010
762
263
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.
 

Rodrigo Gomes

Well-Known Member
Apr 6, 2016
126
29
28
Brazil
cPanel Access Level
Root Administrator
Hello @cPanelLauren ,

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
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.

Beyond that it is beyond our control to determine which domains are allowed to point their IP's to you.
I know that.
But it is my control to choose what to show for them.
 

Rodrigo Gomes

Well-Known Member
Apr 6, 2016
126
29
28
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.