[resolved] Stop hotlinking with custom image (4 posts)

  1. rileybetka
    Posted 3 years ago #

    Hello, I am looking for a good way to stop hotlinking - I found a plugin that seems to work good but I am looking for one that will let me display a custom image rather than some default one. I have followed instructions here to try and stop it: http://www.hongkiat.com/blog/smarter-way-to-prevent-image-hotlinking-with-htaccess/
    but it didn't seem to work - I already have a .htaccess file and I am not sure if I should replace the code that is already in it with the code from this site or just add this stuff to it. This is what my .htaccess file currently looks like:

    # 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]

    # END WordPress
    On a side note - I don't really know what these conditions that are in my htaccess are for - they were generated by WordPress so not sure how important they are

    Am I supposed to replace these rewrite conditions with the ones that are listed on that page or just add them? I tried adding them and it didn't seem to stop the ability to hotlink. Any help is greatly appreciated! Thanks!

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    If you try any anti-hotlinking approach, you run a very real risk of stopping WordPress from display your own images. The rulkes currently in your .htaccess file are a vital part of the custom permalink system in WordPress, They must not be removed and must remain as the last block in your .htaccess file.

  3. rileybetka
    Posted 3 years ago #

    So what would you recommend?

  4. rileybetka
    Posted 3 years ago #

    Nevermind I think I found the solution here:

    thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic