0
하위 폴더가 아닌 루트 폴더에있는 PHP 스크립트를 제외하고 프로젝트 디렉토리의 모든 파일에 대한 HTTP 액세스를 차단하고 싶습니다.루트 PHP 스크립트를 제외한 모든 것을 어떻게 차단할 수 있습니까?
나의 현재의 .htaccess 파일은 다음과 같다 :
# Disable Directory Listings in this Directory and Subdirectories
# This will hide the files from the public unless they know direct URLs
Options -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^api/(.*)$ api.php/$1 [QSA,L]
</IfModule>
# Deny all files from being accessed with Apache
Order Deny,Allow
Deny from all
# Allow specific PHP files at root
<FilesMatch "/(api|cron|status)\.php$">
Order Allow,Deny
Allow from all
</FilesMatch>
이 대부분 api.php 스크립트에 URL 재 작성을 제외하고 작동합니다. FilesMatch 정규식을 /(api|cron|status)(\.php)?$
으로 변경하려고 시도했지만 403 응답을 보내고 있습니다.
누구나 내가 뭘 잘못했는지 설명 할 수 있습니까? 나는 정규 표현식에 일반적으로 확인 해요,하지만이
고마워요. 나는 그것이 문제를 일으키는 주요한 내리침이었다고 생각한다. – 3rgo