You can follow the steps referenced below to Remove IP URL to cPanel (partly taken from our SSL FAQ document) to prevent access to your domain name over it’s IP address.
Introduction
cPanel is one of the most popular control panels among web developers and hosting companies. It is typically paired with WHM (Web Host Manager) – both components work hand-in-hand, with each playing separate roles. Web Host Manager provides administrative control over the server. In addition to server configurations, WHM creates multiple accounts and manages more than one website.
Furthermore, the cPanel dashboard provides various web files, MySQL, statistics, data tracking, and SEO features. It is no wonder that cPanel is one of the most popular control panels among web developers and hosting companies.
To specify, when a hosting provider manages a server with WHM and creates cPanel accounts for their customers, this practice is known as cPanel hosting.
Remove IP URL to cPanel
- Navigate to WHM’s Include Editor interface (Home » Service Configuration » Apache Configuration).
- Select Include editor
- Select the Pre Virtual Host Include option.
- Select the Apache version from the menu. We recommend that you select All Versions.
- Enter the following text in the available text box below:
<VirtualHost IPADDRESS:80> ServerName HOSTNAME DocumentRoot /usr/local/apache/htdocs ServerAdmin EMAIL <IfModule mod_suphp.c> suPHP_UserGroup nobody nobody </IfModule> </VirtualHost> <VirtualHost IPADDRESS:443> ServerName HOSTNAME DocumentRoot /usr/local/apache/htdocs ServerAdmin EMAIL <IfModule mod_suphp.c> suPHP_UserGroup nobody nobody </IfModule> SSLEngine on SSLCertificateFile SSLCERTIFICATEFILE SSLCertificateKeyFile YOUR-SSLCERTIFICATEKEYFILE </VirtualHost>
Note:
This example uses the following values:
IPADDRESS represents your IP address.
HOSTNAME represents your server’s hostname.
EMAIL represents your contact email address.
SSLCERTIFICATEFILE represents the full file path to your SSL certificate.
SSLCERTIFICATEKEYFILE represents the full file path to your SSL certificate’s key.
Click Proceed & Click Update.