Gossamer Forum
Home : Products : Others : Fileman :

Only Referer URL

Quote Reply
Only Referer URL
Hi,
How can I make my file directory to 'only can be accessed' from a particular URL. So, instead of having it password protected, I want it to be open but do not want to let anybody bookmark or access it from any other website.

thanks for keeping the
internet a better place.
Quote Reply
Re: Only Referer URL In reply to
You could use the following codes:

Code:

my $checkurl = "http://www.somedomain.com/page/sompage.html";
if ($ENV{'HTTP_REFERER'} eq "$checkurl") {
&main;
}
else {
print qq|You do not have permissions to access this file|;
}


Although keep in mind that this is a really poor substitute for password protection...if I find the web page where you are redirecting from, I could bookmark it and then continually access/hack your File Manager script. The better solution is to use .htaccess/.htpasswd, that will protect all files in the directory where your admin file manager files are located. Also, there are ways to by-pass environmental variables...so, again, this is a poor substitute. And the codes I provided will not necessarily protect the script...just pseudo protection.

Regards,

Eliot Lee