PHP 에서 HTTP_USER_AGENT 를 이용해서 검색로봇 차단하기 > 개발

본문 바로가기

사이트 내 전체검색

뒤로가기 개발

PHP 에서 HTTP_USER_AGENT 를 이용해서 검색로봇 차단하기

페이지 정보

작성자 관리자 (61.♡.26.29) 작성일 18-02-16 18:38 조회 3,935 댓글 0

본문

[code]
<?php
if(preg_match('/SemrushBot/i',$_SERVER['HTTP_USER_AGENT'])) {
    header('HTTP/1.0 403 Forbidden');
    echo "block!";
    exit();
}
?>
[/code]
[code]
<?php
if(preg_match('/Semrush/is',$_SERVER['HTTP_USER_AGENT'])) {
    header('HTTP/1.0 403 Forbidden');
}
?>
[/code]

** 참고 :
https://www.blackhatworld.com/seo/block-semrush.838057/
https://forums.digitalpoint.com/threads/how-to-block-semrushbot.2800415/

추천0

댓글목록 0

등록된 댓글이 없습니다.

전체 386건 12 페이지
게시물 검색
Copyright © Baragi.Net All rights reserved.
PC 버전으로 보기