Hotlink protection Fails to work (HTACCESS)

Discussion in 'Apache' started by tony.dewhurst, Jun 2, 2012.

  1. #1
    Having an issue where my images are not being protected by hotlink protection here is my code :confused:

    <IfModule mod_rewrite.c>RewriteEngine on
    RewriteBase /
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?pistonspy.com/.*$ [NC]
    RewriteCond %{REQUEST_URI} !^/logo.jpg$ [NC]
    RewriteRule \.(gif|jpg|png)$ http://www.pistonspy.com/logo.jpg [R,L]
    </IfModule>
    
    
    # Expire images header
    #Expire Header
    <FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css|swf)$">
    ExpiresDefault "access plus 2 hours"
    </FilesMatch>
    <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)(\.gz)?$">
    Header unset ETag
    FileETag None
    </FilesMatch>
    
    
    # BEGIN Url Rewrite section
    # (Automatically generated.  Do not edit this section)
    <IfModule mod_rewrite.c>
        RewriteEngine On
    
    
        RewriteBase /
    
    
        RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -d [OR]
        RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php
        RewriteCond %{REQUEST_URI} !/gallery$
        RewriteRule .   -   [L]
    
    
        RewriteCond %{THE_REQUEST} /popular(\?.|\ .)
        RewriteCond %{REQUEST_URI} !/gallery$
        RewriteRule .   /gallery?g2_view=dynamicalbum.PopularAlbum   [QSA,L]
        RewriteCond %{THE_REQUEST} /updates(\?.|\ .)
        RewriteCond %{REQUEST_URI} !/gallery$
        RewriteRule .   /gallery?g2_view=dynamicalbum.UpdatesAlbum   [QSA,L]
        RewriteCond %{THE_REQUEST} /random(\?.|\ .)
        RewriteCond %{REQUEST_URI} !/gallery$
        RewriteRule .   /gallery?g2_view=dynamicalbum.RandomAlbum   [QSA,L]
        RewriteCond %{THE_REQUEST} /key/([^?/]+)(\?.|\ .)
        RewriteCond %{REQUEST_URI} !/gallery$
        RewriteRule .   /gallery?g2_view=keyalbum.KeywordAlbum&g2_keyword=%1   [QSA,L]
        RewriteCond %{THE_REQUEST} /v/([^?]+)(\?.|\ .)
        RewriteCond %{REQUEST_URI} !/gallery$
        RewriteRule .   /gallery?g2_path=%1   [QSA,L]
    </IfModule>
    
    
    # END Url Rewrite section
    
    
    php_value memory_limit 512M
    php_value upload_max_filesize 20M
    php_value post_max_size 20M
    php_value max_execution_time 200
    php_value max_input_time 200
    
    
    
    
    
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    
    # END WordPress
    
    
    
    Code (markup):
     
    tony.dewhurst, Jun 2, 2012 IP