<<Back to Computer Repair + Web design Blog | Computer Topic Categories

Stop people from hotlinking your Blog images in WordPress.

Bandwidth is not free, so why should other people be allowed to hotlink your images to their blog ? Well, It is very easy to prevent people from hotlinking your images from your blog. All you have to do is rewrite your wordpress HTAccess file. Stoping people from hotlinking your images in non-wordpress websites should be the same in Drupal, HTML websites, other CMSes and Joomla for blocking your images from showing up at other sites not on your domain.

Here is my example of my HTACESSS file which is found in the root of my wordpress folder

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?johnsonyip\.com/wordpress [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpe [L
]
</IfModule>
 # END WordPress

All I did was adderd the bolded lines.

Your wordpress htaccess file will look something like this if you have wordpress on your top level of your domain like www.example.com/

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?example\.com/[NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpe [L
]
</IfModule>
 # END WordPress

I also made an image called nohotlink.jpe and placed it in my images directory in my root directory of my domain at johnsonyip.com/images .

nohotlink.jpe

I learned how to do this at  http://altlab.com/htaccess_tutorial.html

Great site for learning about HTAcess mods.

Share and Bookmark:
  • Digg
  • Yahoo! Buzz
  • Facebook
  • Twitter
  • StumbleUpon
  • Reddit
  • del.icio.us
  • Slashdot
  • FriendFeed
  • MisterWong
  • LinkedIn
  • NewsVine
  • Propeller
  • Google Bookmarks
  • Yahoo! Bookmarks
  • Add to favorites
  • RSS
  • email
  • PDF
  • Print

More Related Tech Posts:

About Johnson Yip

I graduated from Vancouver Community College's Information technology Specialist certificate program in 2008 and became Comptia A+ IT Enterprise technician certified in 2009. I volunteer at a non-profit Computer Recycler and Refurbisher called Free Geek Vancouver. My interest includes computers, gadgets, art, movies, food, television, blogging, forums, websites and Video games. Welcome to my blog on computer, hardware, software, web design, and cms help. Enjoy your stay!
This entry was posted in Blog, Blog plans, Blogger/Blogspot, CMS mySQL Blog Forum, Drupal, Forum, Joomla, Online Internet Security, Search Engine Optimization, Security, Website, WordPress, phpBB2, phpBB3 and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv Enabled

Spam protection by WP Captcha-Free