public void UrlReferrerCheck(string refferUrl) { if (Request.UrlReferrer == null) { string script = "< script>alert('직접 접근할 수 없습니다!!');" +"location.href='/Default.aspx'; "; Page.RegisterClientScriptBlock(" done ", script); //Response.Redirect(refferUrl); } else { string refer = Request.UrlReferrer.ToString(); string ServerPath = Request.Url.ToString(); ServerPath = ServerPath.Substring(0, ServerPath.LastIndexOf(" / ")); if (refer.IndexOf(ServerPath) == -1) { string script = " < script> alert('직접 접근할 수 없습니다!!'); " + " location.href = '/Default.aspx'; "; Page.RegisterClientScriptBlock(" done ", script); //Response.Redirect(refferUrl); } } }
2003/10/24
Referrer값 체크로 특정파일에 직접 접근 거부
레퍼러값을 체크하는 방법 2가지 입니다. 먼저, 레퍼러값이 null 값일경우 Default.aspx 페이지로 리다이렉팅. 만일 레퍼러값이 있을경우 현재, 사이트의 도메인과 레퍼러주소의 도메인이 다를경우 다시 Redirect 를 합니다. 바로 Redirect 를 해도 되지만, 자바스크립트로 Alert 를 띄운후 처리..
가장 많이 본 글
-
C:\Program Files (x86)\Symantec\Symantec Endpoint Protection Manager\Tools 의 resetpass.bat 배치 파일을 실행하면 초기화 됨. @echo off setlocalset CATAL...
-
구글... 도대체 뭐하는 짓인지......?? 뭐 내용상으로는,. 누군가 Spam 이라며 신고했다는 건데, 스팸 사이트도 아니고 그럴 내용도 없다. 누군가 악의적으로 신고한것인지 ? 아니면 구글 시스템 오류인건지? 특이한건,. 같은 구글 계정으로 생성...
댓글 없음:
댓글 쓰기