How to allow to view a file in (/../)subfolder using .htaccess ?
Folder structure:
root/
root/.htaccess
root/public
root/public/.htaccess
root/public/index.php
root/public/css
root/public/js
root/.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>
root/public/.htaccess
RewriteEngine On
RewriteBase /public/
Options -MultiViews
#wrong according comments <FilesMatch "public.*" >
Allow from all
#</FilesMatch>
#the rest of htaccess below
If i try to view root/public/index.php, i am getting the error :Forbidden You don't have permission to access /root/public/index.php on this server.
After the corrections, i am getting The server encountered an internal error or misconfiguration and was unable to complete your request.
The error log for the code above says xxx/htdocs/root/.htaccess: <DirectoryMatch not allowed here