Forum Moderators: phranque
First off, am i right in using htaccess, or should i use something else?
Second, here is the code i have been working with, but it doesnt work, any suggestions?
RewriteEngine On
Options +FollowSymLinks# Rewrite /files/yyyy.zzz to test.php?file=yyyy&type=zzz
RewriteRule ^/files/([^/.]+)$.([^/]+)$ /test.php?file=$1&type=$2 [NC,L]
[edited by: Daleeburg at 4:43 pm (utc) on Aug. 31, 2007]
You probably intended "([^/]+)", meaning, "match one or more characters not equal to a slash" or, put another way, "match characters until you find a slash."
Note that it's not necessary to use "[^\.]". Within an alternate character group (defined by square brackets), most characters do not need to be escaped, so "[^.]" should work fine.
Jim
I tried what you said, but it still wont work.
I am trying to make it so that if people go to wwww.website.com/file_man/files/(a number)/(a file name).(a file extension) They can not download the file unless they login and get it though a forced download.
here is what i am up to now.
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?file=$2&type=$3&user=$1 [NC,L]
Instead of doing a rewrite should i maybe do a redirect?