Welcome to WebmasterWorld Guest from 34.201.121.213

Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

Google indexed my site by IP address

how can i remove IP indexed pages from G's index

     
2:28 pm on Dec 15, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 11, 2004
posts:62
votes: 0


Hi Everyone,

I have discovered that my site has been indexed both under domain name and IP address. Exactly how this happened I'm not sure. I 'think' this happened last year during a server move when I decided to run my forum under IP address to prevent messages from being posted both at new and old server during DNS update - big mistake.

Can you use a robots.txt file to remove indexed pages by IP address? If not, will a 301 in my .htaccess file work? I don't know if it's possible to redirect for IP to domain name. If so, a code snippet would greatly be appreciated.

thanks,

Devvy

3:18 pm on Dec 15, 2005 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 18, 2002
posts:355
votes: 0


Assuming you are running under Apache, why not use the same .htaccess used to prevent domain.com / www.domain.com issues. This will also catch the case where someone lands on your site using the IP address:

RewriteEngine on  
RewriteCond %{HTTP_HOST}!^www\.example\.com
RewriteRule ^(.*)$ http://www.example.com/$1 [R=permanent,L]
4:24 pm on Dec 15, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 11, 2004
posts:62
votes: 0


thanks!

And I think I'm learning how these rewrite conditions work.

I had a few lines already to deal with the www / none www issue but mine only looked for the domain, I didn't know you could do wild cards like yours.

I edited your snippet to this so that both IP and non www would get handled and it's working.

RewriteCond %{HTTP_HOST}!^.*\.mydomain\.com
RewriteRule ^(.*)$ [mydomain.com...] [R=301,L]

thanks again,
devvy

4:25 pm on Dec 15, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 11, 2004
posts:62
votes: 0


- sorry, double clicked again and posted twice -