Leech rewrite/redirect

Discussion in 'Apache' started by 3dom, Feb 5, 2008.

  1. #1
    Good day!

    Situation is I have 2 versions of image in different directories: "/upload/storage/image1000.jpg", another "/upload/direct/image1000.jpg". I need to redirect people from "storage" to "direct" folder in case of leeching. How to change last string to make it work?

    
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://yourdomain.com/.*$ [NC]
    RewriteRule \.(jpg|JPG)$ [url]http://yourdomain.com/upload/direct/[/url] ??? .jpg [R]
    
    Code (markup):
    Edit: RewriteRule ^upload/Pictures/storage/(.*)_big\.jpg$ upload/Pictures/direct/$1.jpg [R] doesn't work
     
    3dom, Feb 5, 2008 IP