Could if be problem of my htaccess ? Images cant be seen by some

Discussion in 'Site & Server Administration' started by procrastinator, Apr 6, 2007.

  1. #1
    Its an image hosting site , Basically what ive done is not allowed full images to be hotlinked, only allowed thumbs which reside in a different folder to be hotlinked.

    However, strangely i get lot of people telling me they cant see the full picture, eg

    [​IMG]

    this is the htaccess file , would really appreciate help on this one, whats an image hosting site which doesnt show the full image.

    
    RewriteEngine on
    RewriteCond %{REQUEST_URI} ^/images/thumbs/
    RewriteRule ^.*$ - [L]
    
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^http://www.mysite.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.mysite.com$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.mysite.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.mysite.com$ [NC]
    RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ www.mysite.com [R,NC]
    
    Code (markup):
     
    procrastinator, Apr 6, 2007 IP
  2. rodney88

    rodney88 Guest

    Messages:
    480
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You cannot rely on referrer information as it is supplied by the browser and easily edited or more often not sent at all.

    For clients that aren't sending a referrer, you don't know whether or not it is being hotlinked. If this is causing a problem, you want to add an RewriteCond that ensures we actually do have referrer information to check against.

    RewriteEngine on
    RewriteCond %{REQUEST_URI} ^/images/thumbs/
    RewriteRule ^.*$ - [L]
    
    RewriteCond %{HTTP_REFERER} !^http://www.mysite.com [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ www.mysite.com [R,NC]
    Code (markup):
    I'm not really sure why you have so many rewriteconds all doing the same thing?

    You could actually get rid of the first ruleset too if you placed the .htaccess directly in the /images/thumbs/ directory.
     
    rodney88, Apr 6, 2007 IP