I have a directory full of images, that I do not want viewed by robots, is there a way to make this directory private?
Thanks!
|
I have a directory full of images, that I do not want viewed by robots, is there a way to make this directory private? Thanks!
| |||
|
feedback
|
This question came from our site for professional and enthusiast programmers.
|
How to Use Robots.txt in Search Engine Optimization ( SEO )
Note of the following example :
| |||||||||
feedback
|
|
Create a robots.txt file in your site's root directory. Inside that file put
| |||
|
feedback
|
|
It's called a robots.txt file, and most all robots will honor your requests in your robots.txt. You'll want something like the following:
| |||
|
feedback
|
|
Just as a warning, robots.txt does not keep all robots out, but at least it won't be indexed by Google. | |||
|
feedback
|
|
You want robots.txt | |||
|
feedback
|
|
In your root directory you can place a robots.txt file that forbids robots to index specific directories. | |||
|
feedback
|
|
robots.txt is only obeyed by well-behaved robots. not all of them are well-behaved like those of the major search engines - some are written by incompetent buffoons, some are written by spammers trawling for email addresses, and so on. anyway, you also want to turn Indexes off for that directory...either with a .htaccess file or in your apache conf like so: <Directory /path/to/images/dir> Options -Indexes </Directory > or by by placing a blank index.html file in there.
there's actually very little you can do to really prevent robots from accessing public files on your webserver that won't either inconvenience your users or increase the load on your server by only serving images through a script that only serves to logged-in users (e.g. by checking a cookie). | |||
|
feedback
|