반응형
robots.txt 파일은 루트 디렉토리에 위치하여야 한다.
robots.txt 작성방법
User-agent: *
Allow: /
Disallow: /admin/
Disallow: /*.gif$
sitemap: https://abc.co.kr/sitemap.xml
User-agent: 크롤러 이름 입력, 모든 크롤러를 허용하려면 * 입력하면 된다.
Allow: 크롤링을 허용할 경로
Disallow: 크롤링을 제한할 경로
Sitemap: 사이트맵 위치한 URL
/.*gif$ 는 gif로 끝나는 파일명은 허용하지 않는다는 의미이다.
예시
모든 크롤러, 특정 디렉토리 제외
User-agent: *
Disallow: /admin/
네이버 크롤러만 특정 디렉토리 제외
User-agent: Yeti
Disallow: /admin/
여러개 크롤러를 특정 디렉토리 제외
User-agent: Yeti
User-agent: Bingbot
User-agent: Daum
Disallow: /admin/
반응형