Stop Google from Indexing our server /~user

Steini Petur

Well-Known Member
Apr 24, 2016
54
11
8
Iceland
cPanel Access Level
Root Administrator
I am aware this How to stop google indexing of /~ is 1 year old, I still would like to understand, where did he place the robots.txt, did he put it in his /home/user/? or did he put it in the root directory for WHM/cPanel? It would help me a lot if I could leave the temporary URL possibility open yet block google from indexing our server because it was because of that we closed it, due to google finding malware in maybe 1 home user while other home user suffered as Google detected this as "1 website" and child directories.
 

Steini Petur

Well-Known Member
Apr 24, 2016
54
11
8
Iceland
cPanel Access Level
Root Administrator
Nevermind, but it could come in handy for someone else so the file you are looking for is

/usr/local/apache/conf/httpd.conf

The entry you are looking for is

<VirtualHost 82.221.129.19:80>
ServerName 82.221.129.19
ServerAlias <serverhostname>
DocumentRoot /var/www/html
.....

You would most likely place the robots.txt with the disallow to prevent google from snooping in that folder, so the server.hostname/~user won't be searched allowing you to keep the Temporary URL open :)
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,215
363
Hello,

I'm glad to see you were able to find the answer to your question. Thank you for updating us with the outcome.