Right now I want to redirect users who open up a direct image thats embedded in another site.
livememe does this perfectly by having http://www.livememe.com/36opcf5.jpg
redirect to http://www.livememe.com/36opcf5
even though the direct image url is embedded within another site.
Now I'm trying to acomplish the same thing and this is what I have so far:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?reddit.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?tumblr.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?facebook.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mysite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} ^$
RewriteRule ^i/([a-zA-Z0-9]+)\.(jpe?g|JPE?G)$ /r/$1 [R]
Now from what I understand is that I'm allowing these websites to embed my images in their site but I'm redirecting them if they access the url directly without being refered.
For example on my site I have images located like this: http://mysite.com/i/0b1be.JPG
While the article is located: http://mysite.com/r/0b1be
The redirect works but I'm still failing because you can still access the direct image if you followed it from any of the websites allowed.