OLS Access Control through rewrite rules not working

#1
Hello,

As i'm using OLS with VHost templates i need some access control for a magento site. I followed the kb article but the rewrite rules do not work.

My .htaccess file in the root of the site:

Code:
RewriteEngine On

RewriteRule ^(app|includes|lib|media/downloadable|pkginfo|var)(/.*|)$ - [F,L]

RewriteRule ^/api/rest api.php?type=rest [QSA,L]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
RewriteRule .* - [L,R=405]

RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule .* /index.php [L]
This should give me a 403 error when browsing files inside /lib folder as an example. But i can open .php files without restriction.

Can someone help me fix this? I know i can use contexts but i don't want separate VHost configurations as this should be working with rewrite rules too.

Regards,

Frans
 
Top