RewriteCond를 사용하여 index.html 파일을 무시하는 대신 FilesMatch 지시문을 사용하여 직접 액세스를 제한 할 수 있습니다. FilesMatch는 파일 이름 (예 : index.html)이나 정규식을 기준으로 필터링 할 수있는 정규식을 허용합니다.
완전히 index.html 파일에 대한 액세스를 거부 할 index.html 파일
<FilesMatch "index\.html$">
Order allow,deny
</FilesMatch>
에 대한 액세스를 차단. 나는 이것이 검색 엔진 크롤링에 미칠 부정적인 영향을 알지 못한다는 것을 인정할 것이다. 현재이 그 목록에있는 디렉토리의 나머지 부분에 관해서는 http://httpd.apache.org/docs/current/mod/core.html#filesmatch
를 참조
가 FilesMatch 지침에 대한 자세한 내용을 읽으려면 관계없이 이름의 모든 디렉토리 액세스를 잠글 단지 수 있습니다. 앞으로 나아갈 범위가 좀 더 넓어 질 것입니다.
# Protect specific files from access
<FilesMatch "index\.html$">
Order allow,deny
</FilesMatch>
# Hide directory listing for URL's mapping to a directory
Options -Indexes
# Follow all symbolic links in this directory
Options +FollowSymLinks
# General rewrite rules
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>
: 결국
http://httpd.apache.org/docs/current/mod/core.html#options
를 참조
Options -Indexes
새 htaccess로 파일을 다음과 같이 보일 것이다 옵션 지침에 대한 자세한 내용을 읽으려면