How to generate robots.txt?

Source: Internet
Author: User

Hosts file.

Robots.txt must be placed in the root directory of the website and the file name must be in lowercase. The following is an example:

# Robots.txt file start

# Exclude files from all robots:

User-Agent :*
Disallow:/security/
Disallow:/admin/
Disallow:/admin.htm

# End robots.txt File

Forbidden access statement:
Disallow :/
User-Agent: badbat

Note all # numbers for easy reading.
User-AgentIt is a search engine spider, followed by a "*" sign, indicating that all Spider access is allowed. You can also create an empty robots. TX file.
DisallowYes indicates that directory or file capturing is not allowed,/admin.htm indicates a file,/admin/indicates a site directory, and indicates the scope of file capturing is prohibited.
Disallow :/Yes indicates that all search engine access is prohibited.
User-Agent: badbatYes indicates that access to a search engine is prohibited.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.