WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. rileybetka
    Member
    Posted 1 year 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]
    </IfModule>

    # 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 1 year 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
    Member
    Posted 1 year ago #

    So what would you recommend?

  4. rileybetka
    Member
    Posted 1 year ago #

    Nevermind I think I found the solution here:
    http://wordpress.org/support/topic/help-to-prevent-hotlinking-with-htaccess?replies=8

    thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic