Prevent Directory Listing 디렉토리 목록을 방지하기
January 31st, 2007 · by David Bradley 2007년 1월 31일로 데이비드 브래들리
If you followed my advice to move from Blogspot to your own domain hosted Wordpress blog, then you may have noticed (depending on how your new host server is set up) that opening certain directories produces not the page you were expecting, but a listing of the contents of that directory. 내 충고를 따라 이동하는 경우 블로그를 사용하여 자신의 도메인에서 호스팅하는 wordpress 블로그, 그럼 당신도 알고 있듯이 (당신의 새로운 방법에 따라 호스트 서버가 설정)를 여는 페이지를 특정 디렉토리를 생산을 예상하고 있었 아니지만 목록 이 디렉토리의 내용을합니다.
Now, that’s not usually a problem for most users, it just generates an ugly directory that makes your site look unprofessional. 지금,이 문제는 대부분의 사용자는 일반적으로, 그냥 추악한 디렉토리를 생성하는 비전문가 귀하의 사이트를보세요. However, it can expose file and folder names on your server that you don’t want visitors to browse and read. 그러나, 그것을 귀하의 서버에서 파일 및 폴더 이름에 직면할 수있습니다 원하지 않는 방문을 검색하고 읽을합니다.
There is a very quick fix for this. 이것은 매우 빠른 수정 프로그램이있다.
Open your .htaccess file (usually in the root folder or public_html) 를 여십시오. htaccess 파일을 (보통의 루트 폴더 또는 public_html)
near the top simply enter the following line of code and save the file. 다음과 같은 라인의 상단에 코드를 입력하기만하면됩니다 파일을 저장합니다.
IndexIgnore * 한다 IndexIgnore *
Now, when you try to open that “directory listing” it won’t display the folder’s contents. 지금를 열려고 할 때 "디렉토리 목록"이 폴더의 내용을 표시하지 않습니다.
If you don’t want to block all browsing, just gifs and jpgs or zip files for instance, then use the following syntax instead: 모든 검색을 차단하지 않으려면, 그냥 gifs 및 jpgs 또는 우편 번호 파일을 예를 들면, 다음과 같은 구문을 사용하여 대안 :
IndexIgnore *.gif *.jpg *. gif *. jpg한다 IndexIgnore
IndexIgnore *.zip 한다 IndexIgnore *. 우편 번호
IndexIgnore *.mp3 *. mp3한다 IndexIgnore
(You get the picture) (받으 사진)
Conversely, you might actually want to allow browsing of directories, but it’s disabled on your host by default. 반대로, 브라우징을 허용할 수있습니다 디렉토리를 실제로하지만 이건 기본적으로 여러분의 호스트에 사용 중지합니다. Again, it’sa .htaccess issue, see if IndexIgnore is already in there and delete it, if not enter this line instead: 또, 이것은있습니다. htaccess 문제를 해결하려면이 이미 있는지 확인한다 IndexIgnore 및 삭제할 수있다면이 라인 입력하지 않고 :
Options +Indexes 옵션 + 색인
That opens up directory listing for the root folder (and/or any other folders in which you have a .htaccess file). 디렉토리 목록의 루트 폴더를 열어가 (및 / 또는 다른 폴더에있는가. htaccess 파일).
However, even that is not a particularly elegant solution. 그러나, 그것은, 특히 우아한 솔루션을합니다. What I was finding till I did the following tweak was that Wordpress was displaying the contents of the feed folder rather than displaying the feed. 내가 찾을 때까지 필자의 경우는 다음과 같은 조정의 내용을 표시하는 wordpress가 아닌 폴더에 피드를 표시하는 피드를합니다. So, here’s the solution that makes a click on that directory do the right thing. 그래서, 여기에 솔루션을 만드는 옳은 일을 해당 디렉토리를 클릭하십시오. Open CPanel and navigate to your Index Manager. cpanel 그리고 귀하의 색인에 관리자를 엽니다로 이동합니다. Click the feed folder (or whichever folder you want to block directory listing of) and choose “No Indexes”. 피드를 클릭하여 폴더 (또는 중 하나를 차단하는 디렉토리 목록의 원하는 폴더를)를 선택하고 "아니오 색인을 생성합니다". That got my rss feed for this site working properly, and if applied to other folders too prevents directory listings and spawns a 403 error page, which can be customized. 이 사이트에 대한 내 피드가 올바르게 작동하고있어, 만약 다른 폴더도 적용되는 디렉토리 목록을 방지하고, 403 오류 페이지를 생성하는 사용자 정의할 수있습니다. More on custom 404 and 403 pages another time 더 많은 사용자 정의 404 및 403 페이지를 다른 시간






















0 responses so far ↓ 0 응답을 지금까지는 ↓
Got something to say? 뭔가 할 말이 있나? Start a comment thread here. 여기에 코멘트를 스레드를 시작합니다. Top commentators get a FREE link on the homepage! 해설자 좀 무료 홈페이지에 상위 링크를 클릭하십시오!
Leave a Comment 코멘트를 남겨주세요