Forum Moderators: phranque

Message Too Old, No Replies

How can I ban certain domain names?

         

malasorte

2:01 pm on Apr 10, 2006 (gmt 0)

10+ Year Member



I have a page on my site that offers free wallpapers. These wallpapers have been hot linked by lots of people, especially from profiles on sites like **myspace.com or **hi5.com.

It's eating a lot of my bandwidth, but I don't want to enable hot link protection on my site from Cpanel. Instead, I want to use the Ip Deny manager to block these two sites from accessing my pages. I resolved them into their Ip addresse, added them in the Ip Deny Manager, but nothing.

**myspace.com still shows images from my site in people's profiles... Help!

malasorte

2:37 pm on Apr 10, 2006 (gmt 0)

10+ Year Member



After doing some more reading I added this .htaccess file in my wallpaper directory.

RewriteEngine on
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER}!^http://(www\.)?mydomainname\.com [NC]
RewriteRule \.(gif¦jpe?g)$ - [NC,F]

It works! Because the code is only in the wallpaper directory, I assume that hotlinks to all pages of my site except this will remain possible? (I want this)