Forum Moderators: phranque

Message Too Old, No Replies

Directory listing and downloads counting

Feed certain files to cgi script

         

jimmyz

10:27 am on Feb 15, 2007 (gmt 0)

10+ Year Member



Hi to all!
I' m very new to all this and I would apreciate any help...
My problem is:
I' m using a very nice php script I've found, for directory listing.
But this script lucks the feature of counting (and reporting) file downloads. So I used another script, in perl, for doing this.
But, this one demands from me to change the link for the file to be dowloaded, in the html or php file it is listed in, which in my case, I can not change, since I have no Idea of how to do it.

Example: [mysite.com...] has to be changed to [mysite.com...]

So I thought that If I could tell Apache (who runs on my machine) to change on the fly the links for the files to be downloaded and they are in .rar format to the link as shown in the example, I would be very happy ( for now, I think).

This way, a visitor would cklick on the link generated by the php script and would be feeded to the cgi script to be counted and downloaded.
I've been reading the apache manual for finding out how could I do such a thing, maybe the key is the Rewrite function, but my knowledge is very limited...

jdMorgan

3:56 pm on Feb 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It might be possible to use Apache mod_rewrite to handle this. See this thread [webmasterworld.com] in our forum library. Yours is a simple case of the problem discussed in that thread.

Jim