Forums

Can't Ban Hotlinking (8 posts)

  1. Steve_H
    Member
    Posted 7 years ago #

    I have a new WP blog, with my uploaded images in the wp-content file. I tried to ban hotlinking, but the .htaccess file in the main directory is full of a lot of WP B.S., and when I try to ban hotlinking, it disappears, and only my main page displays.

    I tried putting a separate htaccess in the wp-content folder, but when I did that, the whole site displayed as text.

    What am I doing wrong?

  2. Cypher
    Member
    Posted 7 years ago #

    Ahh all of your .htaccess stuff outside the section that is managed by WP.

    You will see comments indicating that there are WP sections. Anything outside of those sections are not touched by WP.

    Regards

  3. prissed
    Member
    Posted 7 years ago #

    Put it in one .htaccess file, but you have to put it before or after the

    # BEGIN WordPress

    or

    # END WordPress

  4. Mark (podz)
    Support Maven
    Posted 7 years ago #

    I use .htaccess for password purposes.
    Paste the code you need, then press Return twice so as to leave a clear gap between your code and what WP wants to do. Works without problems for me.

  5. Steve_H
    Member
    Posted 7 years ago #

    Okay, thanks for the comments.

    Couldn't figure out what the first one means.

    Second one didn't work.

    Third one didn't work.

    Fourth one didn't work.

    Still trying.

  6. James
    Happiness Engineer
    Posted 7 years ago #

    The main rule about banning hotlinking is to only ban hotlinking in special direcotries that aren't used for anything internally. For example, place all of the files that you don't want anyone hotlinking to into a /ban/ directory, and prevent hotlinking for that directory only.

    And, after banning everyone else, always remember to make sure that your domain is allowed. Otherwise, you're locked out too.

  7. Mark (podz)
    Support Maven
    Posted 7 years ago #

    This is what I have in my image directories. Just a .htaccess with these lines:

    Options +FollowSymlinks
    Options +SymlinksIfOwnerMatch
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://tamba2.org.uk/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.tamba2.org.uk/.*$ [NC]
    ReWriteRule .*.(png|gif|jpg)$ - [N,F,L]

    It seems to do the job :)

  8. Ajay
    Member
    Posted 7 years ago #

    I got a similar .htaccess file as podz in my wp-content, images and wp-images folders

    I also added a robots.txt file in the root folder to prevent spiders from going into the above image folders.

    If spiders don't index images then chances of others finding them is more difficult.

    Recently in Cpanel I ipblocked a lot of servers (mainly warez forums) which were hotlinking to my images.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.