The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to stop google indexing of /~

Discussion in 'General Discussion' started by trec-r, Aug 13, 2016.

  1. trec-r

    trec-r Active Member

    Joined:
    Aug 10, 2008
    Messages:
    41
    Likes Received:
    2
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Some of my client's websites are now showing up in google as mydomain.com/~theirsite. How can I prevent Google from indexing anything in mydomain.com/~. I tried to change the robots.txt file but the google search console still shows the URLs as allowed.
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,146
    Likes Received:
    34
    Trophy Points:
    48
    Location:
    India
    cPanel Access Level:
    Root Administrator
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,789
    Likes Received:
    665
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    The previous post is accurate. You can disable Apache Mod_Userdir via "WHM Home >> Security Center >> Apache mod_userdir Tweak" to ensure that URL is not accessible.

    Thank you.
     
  4. trec-r

    trec-r Active Member

    Joined:
    Aug 10, 2008
    Messages:
    41
    Likes Received:
    2
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Thank you for your replies. However, I do not want to turn off the userdir tweak.

    Got it working now. Updated robots.txt with the following:

    Disallow: /~*/

    Tested in Google Search Console. Looks like it requires the trailing / to work properly.
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,789
    Likes Received:
    665
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page