Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- force a connection throught a php script
September 10, 2004, 9:06 pm
rate this thread
I have a directory with many files (and dir).
In this directory, i have a inde.php file wich display all the file to
I would like to force the users who come in this directory to download only
from the index.php.
I would that they cann't copy the link from the index.php page and paste it
in the url adresse field, but that tey can only clic on the link on the
I tried with the "SetEnvIf Referer" Apache Directive, but it don't run
Any idea or track welcome ;-)
- Janwillem Borleffs
September 10, 2004, 10:33 pm
Re: force a connection throught a php script
One of the many ways to implement this, is to apply Apache's mod_rewrite
RewriteCond % !^.*/index.php
RewriteRule ^([^/]+)$ index.php?$1 [L]
Are now directed to:
Where index.php can use the $_SERVER['QUERY_STRING'] to retrieve and pass
through the requested file.