How to Block Google Indexing? Please help!

Discussion in 'Search Engine Optimization' started by kelfy, May 8, 2009.

  1. #1
    Hi,

    I have a website. Let say "www.pharmacyking.com".

    My hosting account domain is "host.myhost.com"

    People can access my website (www.pahrmacyking.com) through my hosting account domain "host.myhost.com/~admin1".

    However, I found Google has also indexed my website through my hosting account domain. Is there anyway can block this?

    My server is Linux, Apache, PHP, MySQL

    Thanks for you help.
     
    kelfy, May 8, 2009 IP
  2. thinkingahead

    thinkingahead Peon

    Messages:
    129
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try to use a robots.txt and place it in your hosts default folder. Google the format of robots.txt
     
    thinkingahead, May 8, 2009 IP
  3. kelfy

    kelfy Member

    Messages:
    93
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    48
    #3
    Would that block Google indexing my site through (www.pharmacyking.com) ?

    Because I want google index my site with my actual URL instead of my host domain.
     
    kelfy, May 8, 2009 IP
  4. jitendraag

    jitendraag Notable Member

    Messages:
    3,982
    Likes Received:
    324
    Best Answers:
    1
    Trophy Points:
    270
    #4
    Robots.txt won't help in this case. You need a 301 redirect

    
    RewriteEngine On
    RewriteBase /
    
    RewriteCond %{HTTP_HOST} ^host\.myhost\.com$
    RewriteRule (.*) http://www.yourdomain.tld/$1 [R=301,L]
    
    
    Code (markup):
    Use this to make sure all traffic from host domain is redirected to your main domain. Search engines will automatically understand what you mean.
     
    jitendraag, May 8, 2009 IP
  5. kelfy

    kelfy Member

    Messages:
    93
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    48
    #5
    My website is Joomla based. Using sh404SEF for generating good looking URL.

    Can I just paste this code into .htaccess file and it will work?
     
    kelfy, May 9, 2009 IP