0

I want Disallow google images to index my images in these path please let me know that am i right for this code in robots.txt.

/images/otherimages/dir1/here are several images
/images/otherimages/dir2/here are several images

User-agent: googlebot
Disallow: /otherimages/

Kaveh
  • 2,530
  • 7
  • 29
  • 34

1 Answers1

0

There's a special googlebot for images. This here will exclude both:

User-Agent: Googlebot-Image
Disallow:  /images/otherimages/dir1/
Disallow:  /images/otherimages/dir2/

User-Agent: Googlebot
Disallow:  /images/otherimages/dir1/
Disallow:  /images/otherimages/dir2/
576i
  • 7,579
  • 12
  • 55
  • 92
  • thanks,can i test it in webmaster tools? if yes if i have 10 images in both dir1 and dir2 after reading .txt by google and after 2 days in part of URL blocks I must see 10? – Kaveh Jun 04 '13 at 15:37
  • Sorry, I don't understand your comment question. By putting the above "robots.txt" in the root directory of your web page Google will not index those two directories. It will still index your other pages which might include direct links to those images. Opening "http:///images/otherimages/dir1/" will still allow anyone to browse the directories for any image file. If you really want to block access to them you should also place a ".httaccess" file in both directories. – 576i Jun 05 '13 at 07:20
  • Thanks for your help,i did as you mentioned but in google webmaster tools and in section of Blocked URLs i see that Blocked URLs are zero,while in 2 dir i have 10 images,do you think that it is ok? – Kaveh Jun 07 '13 at 04:28