我正在开发一个工具,但我被困在这一点上:我想为每个目录定义一组规则,基本上我只想要“公共”文件夹可用,并拒绝访问其他文件夹。
我的目录结构是
uapi(root)/
Application
Config
Public/
Index.php
Storage
.htaccess
这是 .htaccess 文件
<Directory /Public>
Order Deny, Allow
Allow from all
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ Index.php/$1 [L]
</IfModule>
</Directory>
<Directory /Config>
Order Deny, Allow
Deny from all
</Directory>
<Directory /Application>
Order Deny, Allow
Deny from all
</Directory>
<Directory /Storage>
Order Deny, Allow
Deny from all
</Directory>