The forum is temporarily disabled whilst we move to a new server. Please check back on 1st May.

 
This Forum is Currently Locked – Access is Read Only
You must be logged in to post Login


Lost Your Password?

Search Forums:


 






Minimum search word length is 3 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

Protecting Photos

No Status Selected
UserPost

8:33 am
18 April, 2009


John1

Member

posts 4

Hi Mark,

plug-in has been working great.  I am wondering how to protect against people directly downloading photos.  eg entering the direct URL to the photo.

I see there is a way using htaccess,  though I think there might be a problem as my directory is outside the public_html (as you suggested for setup).

I have tried putting the htaccess file in my TNG directory,  though it doesn't work.  I get the feeling its because its outside the public_html dir.  Perhaps it needs to be done in the plugin code?…………the plugin redirects from the non-public directory to the page in Wordpress that serves the code.

Below is some of the htaccess I have tried.

RewriteEngine On

Options +FollowSymLinks
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\\.)?notrescapade\\.com [NC]
RewriteRule \\.(jpg¦zip¦rar)$ – [F]

#RewriteCond %{HTTP_REFERER} !^$
#RewriteCond %{HTTP_REFERER} !^http://notrescapade.com/.*$ [NC]
#RewriteCond %{HTTP_REFERER} !^http://www.notrescapade.com/.*$ [NC]
#ReWriteRule .*\\.(jpg|jpeg|png|gif)$ – [N,F,L]

12:26 pm
18 April, 2009


Mark Barnes

Admin

posts 349

John,

I'm not an expert on .htaccess but you'd definately need to place your rules in the main .htaccess that Wordpress uses. Technically all the TNG files are served by index.php in your Wordpress root.

You could also modify the plugin to do the same behaviour. That would be easier, actually. Adding a few lines to the mbtng_serve_static_files function (probably at line 74) should do the trick.

Mark


About the Ephesians 4:14 Forum

Forum Timezone: Europe/London

Most Users Ever Online: 30

Forum Stats:

Groups: 1
Forums: 6
Topics: 698
Posts: 2736

Recent New Members: everfree, mbc, cstumpf3, jeffcv, disableme, thurow37