Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Create a Robots.txt File  (Read 14183 times)

0 Members and 1 Guest are viewing this topic.


    Topic Starter
  • Web moderator

  • Hacker

  • kpac®
  • Thanked: 184
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Create a Robots.txt File
« on: December 24, 2008, 05:07:15 PM »
This is a useful file that keeps search engines from indexing pages you do not want spidered. Why would you not want a page indexed by a search engine? Perhaps you want to display a page that shows an example of spamming the search engines. This type of page might include an example of repeated keywords, hidden tags with keywords, and other things that could get a page or an entire site banned from a search engine.

The robots.txt file is a good way to prevent this page from getting indexed. However, not every site can use it. The only robots.txt file that the spiders will read is the one at the top Public HTML directory of your server. This means you can only use it if you run your own domain.

Any other location of the robots.txt file will not be read by a search engine spider.

Now, if you have your own domain, you can see where to place the file. So let's take a look at exactly what needs to go into the robots.txt file to make the spider see what you want done.

If you want to exclude all the search engine spiders from your entire domain, you would write just the following into the robots.txt file:

User-agent: *
Disallow: /

If you want to exclude all the spiders from a certain directory within your site, you would write the following:

User-agent: *
Disallow: /aboutme/

If you want to do this for multiple directories, you add on more Disallow lines:

User-agent: *
Disallow: /aboutme/
Disallow: /stats/

If you want to exclude certain files, then type in the rest of the path to the files you want to exclude:

User-agent: *
Disallow: /aboutme/album.html
Disallow: /stats/refer.htm

If you want to keep a specific search engine spider from indexing your site, do this:

User-agent: <Robot_Name>
Disallow: /

You'll need to know the name of the search engine spider or robot, and place it where <Robot_Name> is above.

You can find the official names of all the known robots on http://www.robotstxt.org/.

So, if you need to exclude something from search engine indexing, this is the most effective tool recognized by the search engines, so use it to keep the spiders out of any part of your web you want them to avoid.

For more info on the Robots.txt file, click here.
« Last Edit: July 19, 2013, 08:39:09 AM by Calum »