Forum Moderators: phranque
RewriteEngine On
Options +FollowSymLinks# Rewrite /file_man/files/#*$!x/yyyy.zzz to test.php?file=yyyy&type=zzz&user=#*$!x
RewriteRule ^file_man/files/([^/]+)/([^\.]+).([^/]+)$ /file_man/test.php?user=$1&file=$2&type=$3 [NC,L]
I could not get the thing to work, but on accident i typed in the name of a file that did not exist and it worked fine. The problem is that I am trying to protect files that do exist. Apparently Apache sees there is a file that the url is referring to and allows downloading before it checks the .htaccess to learn that it should rewrite this url to run it though a confirmation script. Any way to reverse this?
~d
What version of Apache are you running?
Where is this .htaccess code located? In your Web root directory, or elsewhere?
Do you have any other "rewrite to script" rules or mod_alias directives in this .htaccess file, in any .htaccess file(s) above this one, or in the httpd.conf server config file?
Generally, it requires "some other agent" to cause Apache to exit the URL-to-filename translation API phase (where .htaccess is processed) and enter the content-handling phase. Apache core will not do this by itself, so I'm looking for that other "agent" or agents.
Jim
Another work-around, possibly simpler, might be to move all the content files out from under the file_man directory, so the alias only applies to the script itself.
That's all I can come up with based on the provided info.
Jim
It has Apache 1.3
File_man is a folder on the server
The htaccess is in the folder file_man
That is the whole htaccess file
The problem is that I am trying to protect these files from unatherized users downloading them.
I am currently working on my test server, I will try uploading it today and running it hidden on my web server and see if it is just something with my test server.
Thanks
~D