เรื่องของ robot.txt

robot.txt นั้นคืออะไร

เป็นไฟล์ที่ไว้บอก Robot ของ Search Engine ต่างๆว่าไฟล์นี้อนุญาติให้เข้าไปเก็บข้อมูลหรือไม่ (ไม่อยากให้เผยแพร่นั่นเอง) เช่นพวก หน้า admin หรือ ไฟล์ที่สำคัญๆต่างๆ โดยจะเป็นความปลอดภัยเบื้องต้นเท่านั้น

วิธีก็คือเราสร้างไฟล์ที่ชื่อว่า Robot.txt วางไว้ที่ Root ของแต่ละ Directory ที่ต้องการกำหนดการเข้าถึง เข้าถึงไฟล์ หรือ Folder ไหนได้บ้าง โดยวิธีการกำหนดมีดังนี้

# robots.txt for http://www.example.com/

User-agent: *

Disallow: /directoryname/

Disallow: /filename.html
  • User-Agent : ชื่อของ Robot ที่ต้องการ ณที่นี้คือ ทุกตัว *
  • Disallow: หมายถึง ไม่อนุญาติให้ bot เข้าไปอ่านข้อมูล

ถ้าอยากดูตัวอย่างรูปแบบอื่นไปที่นี่เลย http://www.robotstxt.org/orig.html

You can leave a response, or trackback from your own site. Responses are currently closed, but you can trackback from your own site. You can skip to the end and leave a response. Pinging is currently not allowed. Both comments and pings are currently closed.
Powered by WordPress | Shop Free T-Mobile Phones Online | Thanks to Verizon Phones without Contract, MMORPG Games and Sell Car