I have this tree:
libs/
html/
app/
uploads/
files/
images/
male.png
female.png
.htaccess
download.php
.htaccess
index.php
/.htaccess has this content:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -Indexes
</IfModule>
RewriteEngine On
RewriteRule ^ index.php [END,L]
</IfModule>
I want /uploads/.htaccess to:
redirect to download.php
- if existent file, but not this .htaccess or download.php
redirect 404
- if don't match existent file
- or match .htaccess or download.php
- or match existent folder
Examples:
www.example.com/uploads - redirect 404
www.example.com/uploads/files - redirect 404
www.example.com/uploads/images- redirect 404
www.example.com/uploads/.htaccess - redirect 404
www.example.com/uploads/download.php - redirect 404
www.example.com/uploads/nonexistentfile - redirect 404
www.example.com/uploads/images/male.php - redirect download.php
www.example.com/uploads/images/female.php - redirect download.php