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

본문 바로가기
사이트 내 전체검색

개발

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

페이지 정보

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

본문

[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

댓글목록

등록된 댓글이 없습니다.

Total 386건 8 페이지
  • RSS

검색


사이트 정보

Copyright © Baragi.Net. All rights reserved.