htaccess mod rewrite files to go through php first?

Posted by jiexi on Stack Overflow See other posts from Stack Overflow or by jiexi
Published on 2010-04-17T23:32:17Z Indexed on 2010/04/17 23:33 UTC
Read the original article Hit count: 183

Filed under:
|

I have a directory full of files.

Originally people were allowed to direct link to these files. Now i would like to run all files through a php file first.

Could someone help me with the .htaccess needed to do that? The phpfile used to handle the downloads will be called download.php and it will have a get variable called $ref

So i need noob.com/games.zip to goto noob.com/download.php?ref=games.zip BUT still retaining the url of noob.com/games.zip

Thanks!

© Stack Overflow or respective owner

Related posts about .htaccess

Related posts about mod-rewrite