Need htaccess help!

I’m trying to block one specific webpage from hotlinking something from my site. I don’t want to block anything else, just this one guy. I’ve done it with other pages, but unfortunately, something is throwing a wrench into the works – the URL ( contains a question mark, and it’s causing my entire site to crash when I upload the modified .htaccess

Is there any way I can get this to work?

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(www.)?*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(www.)?*$ [NC]
RewriteRule .(jpg|jpeg|gif|png|bmp)$ [R,L]

I maybe much help as I am still learning htaccess stuff. But I did find out that chmod must equal 644 or all havoc will break loose.

try escaping the ? in the url, ie: ?

A ? has a specific symbolic meaning in regexps and you need to escape it if you want it to be treated literally.

Ahh, thank you. That did the trick!

(You’re my new hero!) :stuck_out_tongue_winking_eye:

There is a comprehensive article about this on the DreamHost wiki: Preventing image “hotlinking”

Simon Jessey
Keystone Websites (business site) | si-blog (personal site with affiliate links)

The Wiki didn’t cover the issue I was having with the question mark. It’s been sorted out now, anyway, and I thank you for taking the time to respond to my post. :slight_smile: