Why dont you use Directory statement instead with Allow/Deny and modify the
default 404 page?
On Sep 16, 2011 4:13 AM, "Sebastian Tarach" <[email protected]> wrote:
> Hello,
> I have all my files that I want clients to have access to in one
> folder named assets. I want to forbid direct access to any other
> folders and their files.
>
> RewriteCond %{REQUEST_FILENAME} -f [OR]
> RewriteCond %{REQUEST_FILENAME} -d
> RewriteRule \.(?!assets.+)$ index.php?path=error404
>
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule ^(.*)$ index.php?path=$1
>
> This does not work for some reason. I mean although it allows access
> to any files and folders within assets but it blocks access to non
> existing folders. For instance when I type in domain.com/home or
> domain.com/contact-us or anything else that isn't a folder it treats
> it as a folder ( or file :| ) and redirects me to
> index.php?path=error404 instead of executing second set of rules. Why
> is that and how to fix it?
>
> Regards
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: [email protected]
> " from the digest: [email protected]
> For additional commands, e-mail: [email protected]
>