September 9, 200719 yr I'm adding a download section to my website. I want to track the downloads so I've created a php file that acts as a proxy; it takes one argument: files ($_GET['files']) which is the requested file it then logs it in the database and servers the file. problem is that when I try to set up mod rewrite to make a nice URL structure for it. What I want is: If I type http://download.thomthom.net/test.txt the proxy file will get $_GET['file'] = 'test.txt' If I type http://download.thomthom.net/foo/bar.txt the proxy file will get $_GET['file'] = 'foo/bar.txt' My .htaccess file Options +FollowSymlinks RewriteEngine on RewriteRule ^(.*)$ d.php?file=$1 I though this would do it. But it doesn't. Instead the file argument gets populated with 'd.php'. Which I really can not understand why.
September 10, 200719 yr try posting this on sitepoint - there a couple of mod rewrite buffs over there.
September 10, 200719 yr try posting this on sitepoint - there a couple of mod rewrite buffs over there. guess he beat me to it!
September 10, 200719 yr Author I got it working. The problem was that I caused a loop. I had to prevent it redirecting the redirect. It's all good now!
Create an account or sign in to comment