You want to check and see if the referrer is your domain, and if it's not, redirect the page. This is a common setup and there are many examples out there. https://www.google.com/?gws_rd=ssl#q=apache+directive+disable+hot+linking




Kevin Bucknum
Senior Programmer Analyst
MEDDATA/MEDTRON
Tel: 985-893-2550

-----Original Message-----
From: WEB400 [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Joe W Holt
Sent: Friday, May 20, 2016 1:31 PM
To: Web Enabling the IBM i (AS/400 and iSeries)
Subject: Re: [WEB400] Serving files without direct links perhaps


I did find an apache configuration change that worked although I'm not certain if it will work for long term since I may have more than one domain to deny.

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://example.com/ RewriteRule /* http://www.google.com [R,L]

Adding this and changing the appropriate values I was able to deny one domain. If anyone knows a better way please share.

***
Regards,
Joe W Holt
Sr Programmer/Developer
Jack Onofrio Dog Shows, LLC
405.427.8181



From: "Joe W Holt" <joe.holt@xxxxxxxxxxx>
To: WEB400@xxxxxxxxxxxx
Date: 05/20/2016 12:56 PM
Subject: [WEB400] Serving files without direct links perhaps
Sent by: "WEB400" <web400-bounces@xxxxxxxxxxxx>





Anyone have a great idea on how I can setup either the Apache server, an RPG program, or something else on the IBMi to serve files from our web server to the public but only if they are requesting them from our domain?
We have some issues with others direct linking to some of our docs that we would rather only serve them if they are being clicked when on our site.
I've seen PHP examples but not pulling that trigger yet on our system. Any ideas are appreciated.

***
Regards,
Joe W Holt
Sr Programmer/Developer
Jack Onofrio Dog Shows, LLC
405.427.8181
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/web400.


--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/web400.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.