Forum Moderators: phranque

Message Too Old, No Replies

How to check referral links

and ban from access from other site?

         

grabbags

9:49 am on Nov 8, 2001 (gmt 0)



Hi, I am new in here. I have some content for download and listed in the download.htm
However, there're some other site simply link to my download page to get the files. Please teach me how to check the referral and block them from loading my page directly or redirect to other page if they are not coming from my site.

I prefer to use SSI if possible.
Loading the whole script in every download page is not convienience.

Pleae advice. Thank you in advance.

paynt

2:03 am on Apr 17, 2002 (gmt 0)



Hey grabbags.

Thanks for your post and a belated welcome to Webmaster World. If you are still around I'm hoping this little bump will jumpstart an answer for you.

Sorry we missed this for you.

nonprof webguy

3:43 am on Apr 17, 2002 (gmt 0)

10+ Year Member



Thanks, Paynt, for bringing this back. There is a lot of discussion of scripting for things like Grabbags is looking for in Apache .htaccess -- but not so much about SSI and global.asa. I have a site that is virtually hosted on an MS2K server and have around 100 .pdfs for download and have the same problem as Grabbags. Folks link directly to the .pdf, but I'd prefer to send users to a page that has an abstract of the .pdf and a download link with notes about its size in KB and pages, not to mention the site branding.

Can anyone suggest how I might script my global.asa (or some other server-side thingy) to intercept requests for .pdfs from outside my domain and serve up the abstract page instead? I can do the basic if/then programming, I just don't know enough about how global.asa works to know where in the file to put it, etc. If anyone can recommend a good reference for it, that would be helpful, too.

Key_Master

3:54 am on Apr 17, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



grabbags, better late than never. ;)

Add this to your .htaccess file.

# Prevent offsite links to download.htm
SetEnvIfNoCase Referer ^http://www\.your-domain\.com local
SetEnvIfNoCase Referer ^http://your-domain\.com local
SetEnvIf Referer ^$ local

<Files ~ "download\.htm$">
order deny,allow
deny from all
allow from env=local
</Files>

nonprof webguy

6:07 pm on Apr 17, 2002 (gmt 0)

10+ Year Member



Sorry, I meant IIS, not SSI! A late nite error...