如何允许使用.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