PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I didn't really know where to search or what to search for on this one but how can I prevent people linking to my files from other sites or just keying the URL to the file straight in the address bar?
Some sites force a redirect to an error page if you try to download a file from outside their website (I even if the url isn't "somesite.com/processfile.php?download=somefile" and its just "somesite.com/somefile.ext"). This is what I'm aiming to acheive. I already have forms to go through to hide the URL's for the files when they are downloaded from my site but I also wanted to add this extra security feauture.
Is it a code based feature or an ftp based feature. I cannot edit any configuration files on the server since it is not my server (username.t35.com).
I was hoping to stop people accessing e.g. "mysite.com/somefolder/somfile.mid" not "mysite.com/download.php?file=somfile" because even within my site you are asked to enter the number shown in the image to download and then download.php redirects to the file.
It would be practically impossible for anyone to do it from outside through download.php too since the number they are asked to enter is different every time. The only way they currently access my files from outside is by the most obvious way possible. Just to link to "mysite.com/somefolder/somfile.mid" and bypass download.php.
Maybe I didn't put across what I was trying to do very well. Sorry
Last edited by Chris Corbyn on Thu Apr 15, 2004 8:03 am, edited 1 time in total.
you've got to do something with .htaccess I think - it won't do any good to put php anywhere as the whole problem is people not going through a php page
I see. Ermm. I once tried to create the file .htaccess because I am going to launch my ringtone website onto WAP soon but from some reason when I try to create .htaccess windows says "You Must Enter A Filename".
The FTP software I'm using is called WebDrive and is a virtual drive mapper for windows which makes a new network drive which connects to the ftp.
I wonder if it's just cos windows won't allow these files on it's system? Maybe I'll try WSFTP
I see. Ermm. I once tried to create the file .htaccess because I am going to launch my ringtone website onto WAP soon but from some reason when I try to create .htaccess windows says "You Must Enter A Filename".
The FTP software I'm using is called WebDrive and is a virtual drive mapper for windows which makes a new network drive which connects to the ftp.
I wonder if it's just cos windows won't allow these files on it's system? Maybe I'll try WSFTP
If you can use .htaccess files on your server (you will also require apache's mod_rewrite engine be on) try googling for apache+hotlinking which should turn up planty of tutorials and examples. These examples will use apache's mod_rewrite engine to prevent direct access to the files from outside of your site.