如何允許使用.htaccess查看(/../)subfolder中的文件?如何允許使用.htaccess在(/../)subfolder中查看文件?
文件夾結構:
root/
root/.htaccess
root/public
root/public/.htaccess
root/public/index.php
root/public/css
root/public/js
根/ htaccess的
RewriteEngine On
RewriteBase/
Options -MultiViews
<FilesMatch ".*">
Deny from all
</FilesMatch>
#i tried to add here, public directory permission, but it does not work
#with DirectoryMatch i am getting the error The server encountered an internal error or misconfiguration and was unable to complete your request.
#without DirectoryMatch i am getting the error You don't have permission to access /type705b/public/index.php on this server.
<DirectoryMatch "/public.*">
Allow from All
</DirectoryMatch>
根/公共/ htaccess的
RewriteEngine On
RewriteBase /public/
Options -MultiViews
#wrong according comments <FilesMatch "public.*" >
Allow from all
#</FilesMatch>
#the rest of htaccess below
如果我嘗試查看根/公共/ index.php的,我得到的錯誤:Forbidden You don't have permission to access /root/public/index.php on this server.
更正後,我得到The server encountered an internal error or misconfiguration and was unable to complete your request.
的錯誤日誌,上面的代碼表示xxx/htdocs/root/.htaccess: <DirectoryMatch not allowed here
[.htaccess可能的重複。拒絕根目錄,允許特定的子文件夾。可能?](https://stackoverflow.com/questions/7649794/htaccess-deny-root-allow-specific-subfolder-possible) – matiaslauriti