Deny access to all sites via IP address?

mickael

Member
Aug 3, 2014
16
2
3
cPanel Access Level
Root Administrator
Hi,

Around January, 15 I took a new dedicated server with cpanel and whm but I just noticed that all of my sites can connect to https://domain (it's normal) and also https://ip (it's not normal).

How to deny access to all sites via ip (https://[ip])? because it creates duplicates contents for SEO.

The server has about thirty ip about.
The main ip of the server is not affected

Thank
 
Last edited:

mickael

Member
Aug 3, 2014
16
2
3
cPanel Access Level
Root Administrator
Yes each site to a dedicated IP. There would not be another solution instead of redirection 301 for example to have them redirected to a "Forbidden" folder or to /cgi-sys/defaultwebpage.cgi ?

Like on CentOS 6 before with something like that in pre_virtualhost_global.conf:

<VirtualHost 178.32.xx.xx:80>
ServerName 178.32.xx.xx
DocumentRoot /usr/local/apache/htdocs
ServerAdmin [email protected]
<IfModule mod_suphp.c>
suPHP_UserGroup nobody nobody
</IfModule>
UserDir disabled
</VirtualHost>

Cldt