My webhost gives you two URLs for your website:

  1. the URL on your shared server, which is something like usr283725992783.webhost.com and
  2. your domain URL, which is www.example.com

Google is indexing both of these URLs, but obviously I only want www.example.com to be indexed.

I can't add "nofollow" tags to usr283725992783.webhost.com because that URL serves the same files as www.example.com.

How can I only make Google not follow usr283725992783.webhost.com and keep following www.example.com?

  • Why do you care if the search results end up at your website? I would love to have doubled search results for an important site.
    – Steve
    Jun 6, 2014 at 12:09
  • Many reasons. One, I don't want anyone seeing any more "private" server info than they need to. Two, I use things in PHP such as $_SERVER['HTTP_HOST'] and I don't want to write the code to check for two possibilities (the domain and the server url). And three, it just looks bad having some cryptic URL in the search results. I also don't believe duplicate content on different domains is good for your search rankings.
    – Gavin
    Jun 6, 2014 at 12:23

2 Answers 2


In your case, you will most probably have duplicate content issues and thus indexing issues for your site.

To avoid duplicate content issues with search engines, you can add a rel="canonical" tag (how to use it on Google support) in all your pages to specify the right version of pages is the one from www.example.com.

  • Zistoloen, sorry, I don't think you understood my question. www.example.com is the same as usr283725992783.webhost.com. They both load the exact same files, except www.example.com is simple a domain pointed to usr283725992783.webhost.com. If I changed the .htaccess file, it will affect both usr283725992783.webhost.com and www.example.com because it is the same files.
    – Gavin
    Jun 6, 2014 at 12:18
  • @Gavin: you're right, I have edited my answer.
    – Zistoloen
    Jun 6, 2014 at 13:06
  • Thanks, that seems to be what I need to do. In PHP I'll check which site is being loaded and display the canonical tag if it's usr283725992783.webhost.com.
    – Gavin
    Jun 7, 2014 at 8:43

I thing going for 301 redirect using .htaccess will make google not follow this link.Or you can use robots.txt.

  • Read the first comment of the OP under my answer and please update your answer.
    – Zistoloen
    Jun 6, 2014 at 20:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.