WordPress.org

Ready to get started?Download WordPress

Forums

Anti Hot linking code (does not fully work) (2 posts)

  1. Mobbin01
    Member
    Posted 3 years ago #

    I added this code to my .htaccess in both my root directory and in my wp-content folders:

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(.+.)streetsoffashionseattle.com/ [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteRule .*.(jpe?g|gif|bmp|png)$ http://streetsoffashionseattle.com/wp-content/uploads/2011/04/jesse-jane-dont-hotlink_pg.jpg [L]

    And when I checked the links, only one of worked, as in it could not be linked to, but the others still showed the original image.

    Any reason why this is not working fully?

    Thanks in advance to any replies...

  2. Mobbin01
    Member
    Posted 3 years ago #

    I changed the code around in the .htaccess file to look like this:

    # 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]
    RewriteCond %{HTTP_REFERER} !^http://(.+.)streetsoffashionseattle.com/ [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteRule .*.(jpe?g|gif|bmp|png)$ http://streetsoffashionseattle.com/wp-content/uploads/2011/04/jesse-jane-dont-hotlink_pg.jpg [L]

    </IfModule>

    # END WordPress

    Still nothing has changed and pictures can still be hotlinked to...

Topic Closed

This topic has been closed to new replies.

About this Topic