사이트 내 전체검색
PHP
무단링크 방지하기 (.htaccess 이용)
로빈아빠
https://cmd.kr/php/45 URL이 복사되었습니다.

본문

vi /usr/local/apache/conf/http.conf

---------------------------------------------------------------------------
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
    AllowOverride all  <----------------

#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all  <------------------  all 로 바꿔준다.
</Directory>

#
# UserDir: The name of the directory which is appended onto a user's home
----------------------------------------------------------------------------

htaccess 파일을 만들어 줍니다 그리고 아래의 내용을 적어줍니다

-------------------------------------------------------------------------------------------------
SetEnvIFNoCase Referer "test.co.kr | 210.222.222.222" pass
SetEnvIFNoCase Referer "^$" pass
<FilesMatch ".(jpg|Jpg|gif|Gif|php|Php|exe|Exe)$">
Order deny,allow
deny from all
allow from env=pass
</FilesMatch>
-------------------------------------------------------------------------------------------------

그리고 아파치 /usr/local/apache/htdocs 에 복사 해서 넣어줍니다.

숨김속성은 . 인거 아시죠?

.htaccess

아 문제는 안되는 서버도 있을수 있습니다.

댓글목록

등록된 댓글이 없습니다.

PHP
871 (1/18P)

Search

Copyright © Cmd 명령어 18.223.238.171