본문 바로가기
IT 블로그/웹 개발·SEO

SEO와 트래픽 관리를 위해 robots.txt 활용하기

by noa_xyz 2019. 8. 3.
728x90
728x90

 

 

 

robots.txt에 의해 설정된 규칙들은 

 

SEO(검색엔진 최적화)와 홈페이지/블로그의 트래픽에 영향을 미칩니다.

 

개인적인 홈페이지와 블로그는 대부분

 

 

Uset-agent: *

Allow: /

 

 

를 사용할 것입니다.

 

그렇지만 티스토리 블로그에는 공통적으로 아래의 규칙이 입력되어 있습니다.

 

 

User-agent: *

Disallow: /owner

Disallow: /manage

Disallow: /admin

Disallow: /oldadmin

Disallow: /search

Disallow: /m/search

Disallow: /m/admin

Disallow: /like

Allow: /

 

User-agent: Mediapartners-Google

Allow: /

 

User-agent: bingbot

Crawl-delay: 30

 

 

 

이것을 예시로 robots.txt의 각 속성이 무엇을 의미하고,

 

어떻게 사용되고 조합될 수 있는지 알아봅니다.

 

 

 

 

User-agent

수집 봇의 이름(크롤러의 제품 토큰)을 입력하는 곳입니다.

그로써 규칙의 대상이 될 수집 봇을 정해줍니다.

 

첫 번째 규칙의 User-agent에 입력된 *는 모든 수집 봇을 의미합니다. 

공통적인 규칙을 줄 때 사용합니다.

 

 

두 번째 규칙의 Mediapartners-Google는 구글 애드센스의 제품 토큰입니다.

구글의 여러 크롤러에는 모두 수 십 개의 제품 토큰이 존재합니다.

 

세 번째 규칙의 Bingbot은 빙의 제품 토큰입니다.

 

이렇게 개별적인 이름을 입력해서, 특정 크롤러에게만 규칙을 적용할 수 있습니다.

 

 

 

그밖의 대표적인 수집 봇의 이름은 아래와 같습니다.

 

Googlebot(구글)
Daumoa(다음)
Yeti(네이버)
Slurp(야후)

 

 

 

 

Disallow

봇에 의한 수집을 거부할 디렉토리입니다.

(봇에 의한 불필요한 트래픽 발생을 억제하기 위해서 설정하거나, 회원 정보, 관리 페이지 등 보안이 필요한 디렉토리에 설정합니다.)

 

첫 번째 규칙에서는 모든 수집 봇에게 몇 가지 디렉토리 수집을 거부하고 있는 것이 보입니다.

 

 

 

 

Allow

봇에 의한 수집을 허용할 디렉토리를 입력합니다.

첫 번째 규칙과 두 번째 규칙의

Allow : /

는 모든 디렉토리에의 자료 수집 허용을 의미합니다.

 

 

 

 

첫 번째 규칙은

 

User-agent: *

Disallow: /owner

Disallow: /manage

Disallow: /admin

Disallow: /oldadmin

Disallow: /search

Disallow: /m/search

Disallow: /m/admin

Disallow: /like

Allow: /

 

모든 수집 봇이 설정된 몇 가지 디렉토리의 자료를 수집할 수 없고, 그밖의 모든 디렉토리의 자료는 수집할 수 있도록 허용합니다.

 

 

 

두 번째 규칙은

 

User-agent: Mediapartners-Google

Allow: /

 

구글 애드센스의 수집 봇은 모든 디렉토리의 자료를 수집할 수 있도록 허용합니다.

 

 

 

Allow와 Disallow는

 

Disallow : /private

Allow : /private/something.xml

 

과 같은 조합으로도 사용할 수 있습니다.

 

 

 

 

 

 

세 번째 규칙에는 Crawl-delay 라는 설정이 등장합니다.

 

봇에 의한 수집이 너무 자주 발생하지 않게 딜레이를 둘 수 있으며, 1~30의 값이 입력됩니다.

 

세 번째 규칙은

 

User-agent: bingbot

Crawl-delay: 30

 

Bingbot(빙의 수집 봇)은 한 번 수집을 하면, 30초 이내에는 다시 수집을 하지 않습니다.

 

수집 봇이 수집 목적으로 도메인에 너무 자주 방문해서 불필요한 트래픽이 과하게 발생할 때 주로 사용합니다.

 

 

 

 

 

 

 

 

 

 

+ 참고자료

 

https://www.robotstxt.org/robotstxt.html

 

The Web Robots Pages

About /robots.txt In a nutshell Web site owners use the /robots.txt file to give instructions about their site to web robots; this is called The Robots Exclusion Protocol. It works likes this: a robot wants to vists a Web site URL, say http://www.example.c

www.robotstxt.org

https://en.wikipedia.org/wiki/Robots_exclusion_standard

 

Robots exclusion standard - Wikipedia

The robots exclusion standard, also known as the robots exclusion protocol or simply robots.txt, is a standard used by websites to communicate with web crawlers and other web robots. The standard specifies how to inform the web robot about which areas of t

en.wikipedia.org

 

 

 

 

 

:)

 

728x90
반응형

댓글