LordV
04-20-2009, 05:50 PM
Hey all,
I'm trying to create a htaccess file that will do the following: it has to deny access to all .split files (located in subfolders). In addition it will allow the 'dl.php' file to read the .split files (php's readfile() function (or fopen() or ...)).
The folder structure:
something
| -- .htaccess
| -- dl.php
|
| -- example1
| | -- 0.split
| | -- 1.split
| ` -- 2.split
|
| -- example2
| -- 0.split
| -- 1.split
` -- 2.split
At this site (askapache.com) (http://www.askapache.com/htaccess/mod_rewrite-tips-and-tricks.html) I found this snippet:
Deny access to anything in a subfolder except php fopen
This can be very handy if you want to serve media files or special downloads but only through a php proxy script.
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+)/.*\ HTTP [NC]
RewriteRule .* - [F,L]
but I'm new to htaccess (and regexp :p) so I've no clue how to edit the script so It'll work (I tried).
Thanks in advance.
I forgot to tell, anyone should be able to access the dl.php file...!
I'm trying to create a htaccess file that will do the following: it has to deny access to all .split files (located in subfolders). In addition it will allow the 'dl.php' file to read the .split files (php's readfile() function (or fopen() or ...)).
The folder structure:
something
| -- .htaccess
| -- dl.php
|
| -- example1
| | -- 0.split
| | -- 1.split
| ` -- 2.split
|
| -- example2
| -- 0.split
| -- 1.split
` -- 2.split
At this site (askapache.com) (http://www.askapache.com/htaccess/mod_rewrite-tips-and-tricks.html) I found this snippet:
Deny access to anything in a subfolder except php fopen
This can be very handy if you want to serve media files or special downloads but only through a php proxy script.
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+)/.*\ HTTP [NC]
RewriteRule .* - [F,L]
but I'm new to htaccess (and regexp :p) so I've no clue how to edit the script so It'll work (I tried).
Thanks in advance.
I forgot to tell, anyone should be able to access the dl.php file...!