살인!
html/css/xml
html/css/xml - robots.txt, 사이트 검색 로봇 설정...
이 름 : 바다아이
|
조회수 : 7291
짧은 주소 : https://www.bada-ie.com/su/?621613224433
의무적이지는 않습니다. 다만 서로 업체들끼리 상도덕이라 보시면 됩니다.
원치않는 크롤링을 방지할 수 있습니다.
공백조심하시고 (공백 잘 보세요.. 있는 곳과 없는 곳.. 중요합니다.)
/ 슬래시 주의 하시고요.. 위에부터 순차적 해석입니다.
주석은 # 입니다. // 요거 아닙니다.
예제>
1. 사이트내에 모든 문서를 모든 로봇에게 접근 허용
User-agent: * <-모든 봇
Allow: / <- 모든 문서 허용
2. 사이트내에 모든 문서 모든 봇 차단
User-agent: * <--모든 봇
Disallow: / <--모든 문서 차단
3. 특정봇, 특정 폴더, 파일에 대한 차단
User-agent: * <--모든 봇
Disallow: /owner/ <--특정폴더 차단
Disallow: /admin/
Disallow: /oldadmin/
Disallow: /search/searh.jsp <--특정파일 차단
Disallow: /m/search/
Disallow: /m/admin/
Allow: / <--위에서 차단한 폴더, 문서를 제외한 모든 문서 허용
User-agent: Mediapartners-Google <--특정 봇에 대하여
Allow: / <-- 모든 문서 허용
출처: https://devlinker.tistory.com/4 [Devlinker -Software Developer]
아래는 나무위키에서 퍼왔네요...
반드시 폴더명 맨 끝에 / 를 붙여야 한다.
붙이지 않으면 확장자가 없는 파일로 인식하기 때문에 제대로 작동하지 않는다.
특정 디렉토리의 접근을 허가하려면
User-agent: 제어할 로봇의 User-Agent
Allow: /foo/bar/
특정 디렉토리의 접근을 차단하려면
User-agent: 제어할 로봇의 User-Agent
Disallow: /foo/bar/
모든 문서에 대해 접근을 허가하려면 (사실상 의미는 없다.)
User-agent: *
Allow: /
모든 문서에 대해 접근을 차단하려면
User-agent: *
Disallow: /
모든 문서에 대해 접근을 차단하고, 첫 페이지에 대해서만 허가
User-agent: *
Disallow: /
Allow: /$
나무위키 예제..
User-agent: *
Disallow: /
Allow: /$
Allow: /ads.txt
Allow: /w/
Allow: /backlink/
Allow: /OrphanedPages
Allow: /UncategorizedPages
Allow: /ShortestPages
Allow: /LongestPages
Allow: /RecentChanges
Allow: /RecentDiscuss
Allow: /js/
Allow: /img/
Allow: /css/
Allow: /skins/
Allow: /favicon.ico
Allow: /_nuxt/
|
|